In 10.0-monty, we start seeing failures in main.non_blocking_api.
The failure is seen on BSD, but the root problem exists on all platforms.
The issue is that we get the flag MYSQL_WAIT_TIMEOUT back from
eg. mysql_real_connect_cont(), however mysql_get_timeout_value() returns
(unsigned)-1. This is incorrect, and a change from existing behaviour.
The symptom in the test suite is that tests compute a timeout for poll(2) as
mysql_get_timeout_value()*1000, which ends up as -1000 which is invalid for
poll(2) on bsd (and incorrect in any case).
If no timeout is desired, the MYSQL_WAIT_TIMEOUT flag should not be set.
As far as I can see, the problem is a wrong merge of new VIO stuff in
10.0/10.0-monty. It breaks the non-blocking client library code in 10.0-base
rather badly:
- The timeout values were changed from seconds to milliseconds, but the
non-blocking part was not updated to reflect this.
- vio_io_wait() does not seem to handle non-blocking operation at all, so
will halt any application that uses it.
- There are probably other problems hidden...
An easy way to repeat the problem is to run client/async_example against a
running server with strace:
$ strace -e trace=poll bld/client/async_example 127.0.0.1 root rootpass > /dev/null
poll([
{fd=3, events=POLLOUT}
], 1, -1) = 1 ([
{fd=3, revents=POLLOUT}
])
poll([
{fd=3, events=POLLIN}
], 1, -1000) = 1 ([
{fd=3, revents=POLLIN}
])
Note the second poll() call passing -1000 as timeout - this is incorrect, and
is caused by above issue.
However note that this is not the only problem. All of the new VIO stuff needs
to be fixed for non-blocking operation.
It is particularly important that it is 110% ensured that the non-blocking
client code will never block - this would be a subtle problem that will not be
easily seen in the test suite, but will cause large applications that use
non-blocking mode to become slow or fail.
{"report":{"fcp":943.5,"ttfb":212,"pageVisibility":"visible","entityId":21400,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"201bb351-6adc-4248-af62-ed256d566e31","navigationType":0,"readyForUser":990.1999998092651,"redirectCount":0,"resourceLoadedEnd":579.4000000953674,"resourceLoadedStart":219.5,"resourceTiming":[{"duration":11.099999904632568,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":219.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":219.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":230.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":11.599999904632568,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":219.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":219.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":231.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":290.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/b09d0d077992e4331b5f9ec0d3ec448c-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":219.90000009536743,"connectEnd":219.90000009536743,"connectStart":219.90000009536743,"domainLookupEnd":219.90000009536743,"domainLookupStart":219.90000009536743,"fetchStart":219.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":237.2999997138977,"responseEnd":510.09999990463257,"responseStart":303.09999990463257,"secureConnectionStart":219.90000009536743},{"duration":359.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/b47ab3df14096803b180217eb8482517-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":220,"connectEnd":220,"connectStart":220,"domainLookupEnd":220,"domainLookupStart":220,"fetchStart":220,"redirectEnd":0,"redirectStart":0,"requestStart":237.5,"responseEnd":579.4000000953674,"responseStart":307,"secureConnectionStart":220},{"duration":53,"initiatorType":"script","name":"https://jira.mariadb.org/s/6c569cbf8087ab04e40d0bef98627457-CDN/lu2bsh/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":220.09999990463257,"connectEnd":220.09999990463257,"connectStart":220.09999990463257,"domainLookupEnd":220.09999990463257,"domainLookupStart":220.09999990463257,"fetchStart":220.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":237.5,"responseEnd":273.09999990463257,"responseStart":271,"secureConnectionStart":220.09999990463257},{"duration":54.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":220.2999997138977,"connectEnd":220.2999997138977,"connectStart":220.2999997138977,"domainLookupEnd":220.2999997138977,"domainLookupStart":220.2999997138977,"fetchStart":220.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":237.90000009536743,"responseEnd":275.19999980926514,"responseStart":272.2999997138977,"secureConnectionStart":220.2999997138977},{"duration":55.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":220.2999997138977,"connectEnd":220.2999997138977,"connectStart":220.2999997138977,"domainLookupEnd":220.2999997138977,"domainLookupStart":220.2999997138977,"fetchStart":220.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":238.19999980926514,"responseEnd":275.59999990463257,"responseStart":273.2999997138977,"secureConnectionStart":220.2999997138977},{"duration":16.299999713897705,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bsh/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":220.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":220.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":236.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":16.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bsh/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":220.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":220.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":237,"responseStart":0,"secureConnectionStart":0},{"duration":104.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":220.59999990463257,"connectEnd":220.59999990463257,"connectStart":220.59999990463257,"domainLookupEnd":220.59999990463257,"domainLookupStart":220.59999990463257,"fetchStart":220.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":239.2999997138977,"responseEnd":325.09999990463257,"responseStart":323.2999997138977,"secureConnectionStart":220.59999990463257},{"duration":54.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/81b5d7c27af3ebc078cc4a36383678ba-CDN/lu2bsh/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":220.7999997138977,"connectEnd":220.7999997138977,"connectStart":220.7999997138977,"domainLookupEnd":220.7999997138977,"domainLookupStart":220.7999997138977,"fetchStart":220.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":239.90000009536743,"responseEnd":275.69999980926514,"responseStart":273.7999997138977,"secureConnectionStart":220.7999997138977},{"duration":34.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":221.5,"connectEnd":221.5,"connectStart":221.5,"domainLookupEnd":221.5,"domainLookupStart":221.5,"fetchStart":221.5,"redirectEnd":0,"redirectStart":0,"requestStart":221.5,"responseEnd":256.19999980926514,"responseStart":256.19999980926514,"secureConnectionStart":221.5},{"duration":344.2999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":228.40000009536743,"connectEnd":228.40000009536743,"connectStart":228.40000009536743,"domainLookupEnd":228.40000009536743,"domainLookupStart":228.40000009536743,"fetchStart":228.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":267.7999997138977,"responseEnd":572.6999998092651,"responseStart":570.9000000953674,"secureConnectionStart":228.40000009536743},{"duration":179.7000002861023,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":698.7999997138977,"connectEnd":698.7999997138977,"connectStart":698.7999997138977,"domainLookupEnd":698.7999997138977,"domainLookupStart":698.7999997138977,"fetchStart":698.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":845.1999998092651,"responseEnd":878.5,"responseStart":877.9000000953674,"secureConnectionStart":698.7999997138977}],"fetchStart":0,"domainLookupStart":18,"domainLookupEnd":31,"connectStart":31,"connectEnd":52,"secureConnectionStart":41,"requestStart":53,"responseStart":212,"responseEnd":228,"domLoading":215,"domInteractive":1036,"domContentLoadedEventStart":1036,"domContentLoadedEventEnd":1071,"domComplete":2296,"loadEventStart":2296,"loadEventEnd":2296,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1018.5999999046326},{"name":"bigPipe.sidebar-id.end","time":1019.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1019.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1020.9000000953674},{"name":"activityTabFullyLoaded","time":1084.6999998092651}],"measures":[],"correlationId":"95d201d8b9b0e8","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":73,"dbReadsTimeInMs":16,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}