Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
03f5dc53
Commit
03f5dc53
authored
25 years ago
by
Fredrik Hübinette (Hubbe)
Browse files
Options
Downloads
Patches
Plain Diff
make watchdog exit more quitly, helps profiling..
Rev: bin/test_pike.pike:1.38
parent
ef708278
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/test_pike.pike
+22
-8
22 additions, 8 deletions
bin/test_pike.pike
with
22 additions
and
8 deletions
bin/test_pike.pike
+
22
−
8
View file @
03f5dc53
#!/usr/local/bin/pike
#!/usr/local/bin/pike
/* $Id: test_pike.pike,v 1.3
7
2000/03/
07 08:14:57
hubbe Exp $ */
/* $Id: test_pike.pike,v 1.3
8
2000/03/
20 20:57:34
hubbe Exp $ */
import Stdio;
import Stdio;
...
@@ -181,9 +181,9 @@ int main(int argc, string *argv)
...
@@ -181,9 +181,9 @@ int main(int argc, string *argv)
while(1)
while(1)
{
{
sleep(10);
sleep(10);
if(exit_quietly) exit(0);
if(exit_quietly)
_
exit(0);
#ifndef __NT__
#ifndef __NT__
if(!kill(pid, 0)) exit(0);
if(!kill(pid, 0))
_
exit(0);
#endif
#endif
// werror("[WATCHDOG] t=%d\n",time()-last_time);
// werror("[WATCHDOG] t=%d\n",time()-last_time);
...
@@ -192,12 +192,12 @@ int main(int argc, string *argv)
...
@@ -192,12 +192,12 @@ int main(int argc, string *argv)
{
{
werror("\n[WATCHDOG] Pike testsuite timeout, sending SIGABRT.\n");
werror("\n[WATCHDOG] Pike testsuite timeout, sending SIGABRT.\n");
kill(pid, signum("SIGABRT"));
kill(pid, signum("SIGABRT"));
for(int q=0;q<60;q++) if(!kill(pid,0)) exit(0); else sleep(1);
for(int q=0;q<60;q++) if(!kill(pid,0))
_
exit(0); else sleep(1);
werror("\n"
werror("\n"
"[WATCHDOG] This is your friendly watchdog again...\n"
"[WATCHDOG] This is your friendly watchdog again...\n"
"[WATCHDOG] testsuite failed to die from SIGABRT, sending SIGKILL\n");
"[WATCHDOG] testsuite failed to die from SIGABRT, sending SIGKILL\n");
kill(pid, signum("SIGKILL"));
kill(pid, signum("SIGKILL"));
for(int q=0;q<60;q++) if(!kill(pid,0)) exit(0); else sleep(1);
for(int q=0;q<60;q++) if(!kill(pid,0))
_
exit(0); else sleep(1);
werror("\n"
werror("\n"
"[WATCHDOG] This is your friendly watchdog AGAIN...\n"
"[WATCHDOG] This is your friendly watchdog AGAIN...\n"
"[WATCHDOG] SIGKILL, SIGKILL, SIGKILL, DIE!\n");
"[WATCHDOG] SIGKILL, SIGKILL, SIGKILL, DIE!\n");
...
@@ -205,14 +205,14 @@ int main(int argc, string *argv)
...
@@ -205,14 +205,14 @@ int main(int argc, string *argv)
kill(pid, signum("SIGKILL"));
kill(pid, signum("SIGKILL"));
kill(pid, signum("SIGKILL"));
kill(pid, signum("SIGKILL"));
kill(pid, signum("SIGKILL"));
kill(pid, signum("SIGKILL"));
for(int q=0;q<60;q++) if(!kill(pid,0)) exit(0); else sleep(1);
for(int q=0;q<60;q++) if(!kill(pid,0))
_
exit(0); else sleep(1);
werror("\n"
werror("\n"
"[WATCHDOG] Giving up, must be a device wait.. :(\n");
"[WATCHDOG] Giving up, must be a device wait.. :(\n");
exit(0);
_
exit(0);
}
}
}
}
#else
#else
exit(1);
_
exit(1);
#endif
#endif
break;
break;
...
@@ -641,7 +641,21 @@ int main(int argc, string *argv)
...
@@ -641,7 +641,21 @@ int main(int argc, string *argv)
#ifdef WATCHDOG_SIGNAL
#ifdef WATCHDOG_SIGNAL
if(use_watchdog)
if(use_watchdog)
{
watchdog->kill(signum("SIGKILL"));
watchdog->kill(signum("SIGKILL"));
watchdog->wait();
}
#endif
#ifdef WATCHDOG_PIPE
if(use_watchdog)
{
destruct(watchdog_pipe);
#if constant(signum)
catch { watchdog->kill(signum("SIGKILL")); };
#endif
watchdog->wait();
}
#endif
#endif
return errors;
return errors;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment