Marko: IMO that one should be replaced with something like SIGINT, wait a bit, SIGABRT (to get proof of server shutdown hang), wait a bit more, then SIGKILL
I think that sometimes this is not enough. But, if we apply all of my patch below (which I used on 10.5 to make one test rr-friendly), then replication tests will start failing massively (because apparently they like to SIGKILL processes).
- mtr_debug("Sending SIGKILL to pids: " . join(' ', @pids));
- kill(9, @pids);
+ mtr_debug("Sending SIGABRT to pids: " . join(' ', @pids));
+ kill(6, @pids);
mtr_report("Sleep 1 second waiting for processes to die");
sleep(1) # Wait one second
} while ( $retries-- and kill(0, @pids) );
Maybe a subset of this would be safe to apply?
Marko Mäkelä
added a comment - I think that sometimes this is not enough. But, if we apply all of my patch below (which I used on 10.5 to make one test rr -friendly), then replication tests will start failing massively (because apparently they like to SIGKILL processes).
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 417d3615995..48b8f132eb2 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -5141,7 +5141,7 @@ void do_shutdown_server(struct st_command *command)
if (timeout)
(void) my_kill(pid, SIGABRT);
/* Give server a few seconds to die in all cases */
- if (!timeout || wait_until_dead(pid, timeout < 5 ? 5 : timeout))
+ if (!timeout || wait_until_dead(pid, timeout < 60 ? 60 : timeout))
{
(void) my_kill(pid, SIGKILL);
}
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc
index 4d0d1e2a3a0..abc167a4300 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process.cc
@@ -144,7 +144,7 @@ static int kill_child(bool was_killed)
message("Killing child: %d", child_pid);
// Terminate whole process group
if (! was_killed)
- kill(-child_pid, SIGKILL);
+ kill(-child_pid, SIGABRT);
pid_t ret_pid= waitpid(child_pid, &status, 0);
if (ret_pid == child_pid)
diff --git a/mysql-test/lib/v1/mtr_process.pl b/mysql-test/lib/v1/mtr_process.pl
index fd9f3817699..ee9a370c467 100644
--- a/mysql-test/lib/v1/mtr_process.pl
+++ b/mysql-test/lib/v1/mtr_process.pl
@@ -456,8 +456,8 @@ sub mtr_kill_leftovers () {
my $retries= 10; # 10 seconds
do
{
- mtr_debug("Sending SIGKILL to pids: " . join(' ', @pids));
- kill(9, @pids);
+ mtr_debug("Sending SIGABRT to pids: " . join(' ', @pids));
+ kill(6, @pids);
mtr_report("Sleep 1 second waiting for processes to die");
sleep(1) # Wait one second
} while ( $retries-- and kill(0, @pids) );
Maybe a subset of this would be safe to apply?
People
Aleksey Midenkov
Nikita Malyavin
Votes:
0Vote for this issue
Watchers:
2Start watching this issue
Dates
Created:
Updated:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":767.6000001430511,"ttfb":155.10000014305115,"pageVisibility":"visible","entityId":91898,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"a3e3e9e5-b71c-4df8-8acf-c87e15a11565","navigationType":0,"readyForUser":828,"redirectCount":0,"resourceLoadedEnd":504.7999999523163,"resourceLoadedStart":164.10000014305115,"resourceTiming":[{"duration":6,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":164.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":164.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":170.10000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":5.799999952316284,"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":164.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":164.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":170.20000004768372,"responseStart":0,"secureConnectionStart":0},{"duration":196.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/b09d0d077992e4331b5f9ec0d3ec448c-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":164.5,"connectEnd":172.29999995231628,"connectStart":172.29999995231628,"domainLookupEnd":172.29999995231628,"domainLookupStart":172.29999995231628,"fetchStart":164.5,"redirectEnd":0,"redirectStart":0,"requestStart":172.60000014305115,"responseEnd":361,"responseStart":186.20000004768372,"secureConnectionStart":172.29999995231628},{"duration":339.89999985694885,"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":164.90000009536743,"connectEnd":164.90000009536743,"connectStart":164.90000009536743,"domainLookupEnd":164.90000009536743,"domainLookupStart":164.90000009536743,"fetchStart":164.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":173.90000009536743,"responseEnd":504.7999999523163,"responseStart":197.60000014305115,"secureConnectionStart":164.90000009536743},{"duration":30.5,"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":165,"connectEnd":165,"connectStart":165,"domainLookupEnd":165,"domainLookupStart":165,"fetchStart":165,"redirectEnd":0,"redirectStart":0,"requestStart":174.90000009536743,"responseEnd":195.5,"responseStart":190.90000009536743,"secureConnectionStart":165},{"duration":30.799999952316284,"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":165.70000004768372,"connectEnd":165.70000004768372,"connectStart":165.70000004768372,"domainLookupEnd":165.70000004768372,"domainLookupStart":165.70000004768372,"fetchStart":165.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":175.60000014305115,"responseEnd":196.5,"responseStart":192,"secureConnectionStart":165.70000004768372},{"duration":38.799999952316284,"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":165.90000009536743,"connectEnd":165.90000009536743,"connectStart":165.90000009536743,"domainLookupEnd":165.90000009536743,"domainLookupStart":165.90000009536743,"fetchStart":165.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":177,"responseEnd":204.70000004768372,"responseStart":201.5,"secureConnectionStart":165.90000009536743},{"duration":9.299999952316284,"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":166,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":166,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":175.29999995231628,"responseStart":0,"secureConnectionStart":0},{"duration":38.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":166,"connectEnd":166,"connectStart":166,"domainLookupEnd":166,"domainLookupStart":166,"fetchStart":166,"redirectEnd":0,"redirectStart":0,"requestStart":178.60000014305115,"responseEnd":204.90000009536743,"responseStart":202.29999995231628,"secureConnectionStart":166},{"duration":10.700000047683716,"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":166.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":166.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":176.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":39.5,"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":166.29999995231628,"connectEnd":166.29999995231628,"connectStart":166.29999995231628,"domainLookupEnd":166.29999995231628,"domainLookupStart":166.29999995231628,"fetchStart":166.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":180.20000004768372,"responseEnd":205.79999995231628,"responseStart":203,"secureConnectionStart":166.29999995231628},{"duration":256,"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":194.20000004768372,"connectEnd":194.20000004768372,"connectStart":194.20000004768372,"domainLookupEnd":194.20000004768372,"domainLookupStart":194.20000004768372,"fetchStart":194.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":264.40000009536743,"responseEnd":450.2000000476837,"responseStart":441.5,"secureConnectionStart":194.20000004768372},{"duration":256.40000009536743,"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":194.29999995231628,"connectEnd":194.29999995231628,"connectStart":194.29999995231628,"domainLookupEnd":194.29999995231628,"domainLookupStart":194.29999995231628,"fetchStart":194.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":297.10000014305115,"responseEnd":450.7000000476837,"responseStart":443.10000014305115,"secureConnectionStart":194.29999995231628},{"duration":67.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":503.90000009536743,"connectEnd":503.90000009536743,"connectStart":503.90000009536743,"domainLookupEnd":503.90000009536743,"domainLookupStart":503.90000009536743,"fetchStart":503.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":542.2999999523163,"responseEnd":571.5,"responseStart":570.7000000476837,"secureConnectionStart":503.90000009536743},{"duration":240.89999985694885,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":723.9000000953674,"connectEnd":723.9000000953674,"connectStart":723.9000000953674,"domainLookupEnd":723.9000000953674,"domainLookupStart":723.9000000953674,"fetchStart":723.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":933.1000001430511,"responseEnd":964.7999999523163,"responseStart":964.1000001430511,"secureConnectionStart":723.9000000953674},{"duration":228.89999985694885,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":760.6000001430511,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":760.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":989.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":20,"responseStart":155,"responseEnd":193,"domLoading":158,"domInteractive":928,"domContentLoadedEventStart":928,"domContentLoadedEventEnd":980,"domComplete":1354,"loadEventStart":1354,"loadEventEnd":1355,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":906.6000001430511},{"name":"bigPipe.sidebar-id.end","time":907.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":907.6000001430511},{"name":"bigPipe.activity-panel-pipe-id.end","time":909.6000001430511},{"name":"activityTabFullyLoaded","time":998.2999999523163}],"measures":[],"correlationId":"e72604794aafc3","effectiveType":"4g","downlink":9.7,"rtt":0,"serverDuration":66,"dbReadsTimeInMs":8,"dbConnsTimeInMs":15,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I think that sometimes this is not enough. But, if we apply all of my patch below (which I used on 10.5 to make one test rr-friendly), then replication tests will start failing massively (because apparently they like to SIGKILL processes).
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 417d3615995..48b8f132eb2 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -5141,7 +5141,7 @@ void do_shutdown_server(struct st_command *command)
if (timeout)
(void) my_kill(pid, SIGABRT);
/* Give server a few seconds to die in all cases */
- if (!timeout || wait_until_dead(pid, timeout < 5 ? 5 : timeout))
+ if (!timeout || wait_until_dead(pid, timeout < 60 ? 60 : timeout))
{
(void) my_kill(pid, SIGKILL);
}
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc
index 4d0d1e2a3a0..abc167a4300 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process.cc
@@ -144,7 +144,7 @@ static int kill_child(bool was_killed)
message("Killing child: %d", child_pid);
// Terminate whole process group
if (! was_killed)
- kill(-child_pid, SIGKILL);
+ kill(-child_pid, SIGABRT);
pid_t ret_pid= waitpid(child_pid, &status, 0);
if (ret_pid == child_pid)
diff --git a/mysql-test/lib/v1/mtr_process.pl b/mysql-test/lib/v1/mtr_process.pl
index fd9f3817699..ee9a370c467 100644
--- a/mysql-test/lib/v1/mtr_process.pl
+++ b/mysql-test/lib/v1/mtr_process.pl
@@ -456,8 +456,8 @@ sub mtr_kill_leftovers () {
my $retries= 10; # 10 seconds
do
{
- mtr_debug("Sending SIGKILL to pids: " . join(' ', @pids));
- kill(9, @pids);
+ mtr_debug("Sending SIGABRT to pids: " . join(' ', @pids));
+ kill(6, @pids);
mtr_report("Sleep 1 second waiting for processes to die");
sleep(1) # Wait one second
Maybe a subset of this would be safe to apply?