Type:
Bug
Priority:
Minor
Resolution:
Fixed
Affects Version/s:
2.1
Component/s:
None
This is the block of code from libmariadb.c:
if (mysql->options.connect_timeout >= 0 &&
vio_wait_or_timeout(net->vio, FALSE, mysql->options.connect_timeout * 1000) < 1)
{
my_set_error(mysql, CR_SERVER_LOST, SQLSTATE_UNKNOWN,
ER(CR_SERVER_LOST_EXTENDED),
"handshake: waiting for inital communication packet",
errno);
goto error;
}
The second option of vio_wait_or_timeout() is "my_bool is_read". If set to true, it waits for a read. If set to false, it waits for a write. The code above is waiting to read a packet from the server, so it should be TRUE. However, it is false, so it waits for a write instead. Since this happens immediately after it has already waited for the connection, this always returns immediately. However, on async it passes the wrong flags (i.e. WAIT_WRITE instead of WAIT_READ) to the async caller, which messes up edge-triggered event handling. It also means that it does not actually wait for the timeout that it is supposed to be waiting for.
Georg Richter
made changes -
2015-09-08 08:41
Field
Original Value
New Value
Description
This is the block of code from libmariadb.c:
if (mysql->options.connect_timeout >= 0 &&
vio_wait_or_timeout(net->vio, FALSE, mysql->options.connect_timeout * 1000) < 1)
{
my_set_error(mysql, CR_SERVER_LOST, SQLSTATE_UNKNOWN,
ER(CR_SERVER_LOST_EXTENDED),
"handshake: waiting for inital communication packet",
errno);
goto error;
}
The second option of vio_wait_or_timeout() is "my_bool is_read". If set to true, it waits for a read. If set to false, it waits for a write. The code above is waiting to read a packet from the server, so it should be TRUE. However, it is false, so it waits for a write instead. Since this happens immediately after it has already waited for the connection, this always returns immediately. However, on async it passes the wrong flags (i.e. WAIT_WRITE instead of WAIT_READ) to the async caller, which messes up edge-triggered event handling. It also means that it does not actually wait for the timeout that it is supposed to be waiting for.
This is the block of code from libmariadb.c:
{code}
if (mysql->options.connect_timeout >= 0 &&
vio_wait_or_timeout(net->vio, FALSE, mysql->options.connect_timeout * 1000) < 1)
{
my_set_error(mysql, CR_SERVER_LOST, SQLSTATE_UNKNOWN,
ER(CR_SERVER_LOST_EXTENDED),
"handshake: waiting for inital communication packet",
errno);
goto error;
}
{code}
The second option of vio_wait_or_timeout() is "my_bool is_read". If set to true, it waits for a read. If set to false, it waits for a write. The code above is waiting to read a packet from the server, so it should be TRUE. However, it is false, so it waits for a write instead. Since this happens immediately after it has already waited for the connection, this always returns immediately. However, on async it passes the wrong flags (i.e. WAIT_WRITE instead of WAIT_READ) to the async caller, which messes up edge-triggered event handling. It also means that it does not actually wait for the timeout that it is supposed to be waiting for.
Georg Richter
made changes -
2015-09-08 11:21
Fix Version/s
2.2.0
[ 19500
]
Resolution
Fixed
[ 1
]
Status
Open
[ 1
]
Closed
[ 6
]
Julien Fritsch
made changes -
2022-01-11 15:33
Workflow
MariaDB connectors
[ 69869
]
MariaDB v4
[ 160990
]
{"report":{"fcp":1215,"ttfb":316.79999923706055,"pageVisibility":"visible","entityId":51669,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"a0d7141e-ea91-4189-b4cd-4dee9d9642ac","navigationType":0,"readyForUser":1314.2999992370605,"redirectCount":0,"resourceLoadedEnd":920.1999998092651,"resourceLoadedStart":325.5,"resourceTiming":[{"duration":44.79999923706055,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":325.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":325.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":370.29999923706055,"responseStart":0,"secureConnectionStart":0},{"duration":45,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":325.79999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":325.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":370.79999923706055,"responseStart":0,"secureConnectionStart":0},{"duration":364.29999923706055,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":326,"connectEnd":326,"connectStart":326,"domainLookupEnd":326,"domainLookupStart":326,"fetchStart":326,"redirectEnd":0,"redirectStart":0,"requestStart":369.3999996185303,"responseEnd":690.2999992370605,"responseStart":382.0999994277954,"secureConnectionStart":326},{"duration":575.0999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":326.19999980926514,"connectEnd":367.79999923706055,"connectStart":367.79999923706055,"domainLookupEnd":367.79999923706055,"domainLookupStart":367.79999923706055,"fetchStart":326.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":369.19999980926514,"responseEnd":901.2999992370605,"responseStart":385.79999923706055,"secureConnectionStart":367.79999923706055},{"duration":72.10000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":326.3999996185303,"connectEnd":326.3999996185303,"connectStart":326.3999996185303,"domainLookupEnd":326.3999996185303,"domainLookupStart":326.3999996185303,"fetchStart":326.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":374.0999994277954,"responseEnd":398.5,"responseStart":395,"secureConnectionStart":326.3999996185303},{"duration":80.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":326.5999994277954,"connectEnd":326.5999994277954,"connectStart":326.5999994277954,"domainLookupEnd":326.5999994277954,"domainLookupStart":326.5999994277954,"fetchStart":326.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":376.79999923706055,"responseEnd":407.29999923706055,"responseStart":398.79999923706055,"secureConnectionStart":326.5999994277954},{"duration":80.60000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":326.79999923706055,"connectEnd":326.79999923706055,"connectStart":326.79999923706055,"domainLookupEnd":326.79999923706055,"domainLookupStart":326.79999923706055,"fetchStart":326.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":377.19999980926514,"responseEnd":407.3999996185303,"responseStart":401.8999996185303,"secureConnectionStart":326.79999923706055},{"duration":48,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":327,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":327,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":375,"responseStart":0,"secureConnectionStart":0},{"duration":82.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":327.19999980926514,"connectEnd":327.19999980926514,"connectStart":327.19999980926514,"domainLookupEnd":327.19999980926514,"domainLookupStart":327.19999980926514,"fetchStart":327.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":377.79999923706055,"responseEnd":409.3999996185303,"responseStart":403.69999980926514,"secureConnectionStart":327.19999980926514},{"duration":48.40000057220459,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":327.29999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":327.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":375.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":84.39999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":327.3999996185303,"connectEnd":327.3999996185303,"connectStart":327.3999996185303,"domainLookupEnd":327.3999996185303,"domainLookupStart":327.3999996185303,"fetchStart":327.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":378.19999980926514,"responseEnd":411.79999923706055,"responseStart":405.0999994277954,"secureConnectionStart":327.3999996185303},{"duration":587.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":331.5999994277954,"connectEnd":331.5999994277954,"connectStart":331.5999994277954,"domainLookupEnd":331.5999994277954,"domainLookupStart":331.5999994277954,"fetchStart":331.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":533,"responseEnd":919.0999994277954,"responseStart":913.0999994277954,"secureConnectionStart":331.5999994277954},{"duration":588.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":331.5999994277954,"connectEnd":331.5999994277954,"connectStart":331.5999994277954,"domainLookupEnd":331.5999994277954,"domainLookupStart":331.5999994277954,"fetchStart":331.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":604.1999998092651,"responseEnd":920.1999998092651,"responseStart":916.2999992370605,"secureConnectionStart":331.5999994277954},{"duration":317.69999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":885.3999996185303,"connectEnd":885.3999996185303,"connectStart":885.3999996185303,"domainLookupEnd":885.3999996185303,"domainLookupStart":885.3999996185303,"fetchStart":885.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1171.3999996185303,"responseEnd":1203.0999994277954,"responseStart":1202.3999996185303,"secureConnectionStart":885.3999996185303},{"duration":328.30000019073486,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1200.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1200.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1529.1999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":135,"responseStart":317,"responseEnd":328,"domLoading":320,"domInteractive":1471,"domContentLoadedEventStart":1471,"domContentLoadedEventEnd":1524,"domComplete":2391,"loadEventStart":2391,"loadEventEnd":2391,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1388.7999992370605},{"name":"bigPipe.sidebar-id.end","time":1389.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1389.7999992370605},{"name":"bigPipe.activity-panel-pipe-id.end","time":1391.5999994277954},{"name":"activityTabFullyLoaded","time":1541.0999994277954}],"measures":[],"correlationId":"a62409627cab6","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":125,"dbReadsTimeInMs":11,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}