svn commit: r207348 - head/sbin/hastd
Pawel Jakub Dawidek
pjd at FreeBSD.org
Wed Apr 28 22:41:06 UTC 2010
Author: pjd
Date: Wed Apr 28 22:41:06 2010
New Revision: 207348
URL: http://svn.freebsd.org/changeset/base/207348
Log:
Restart worker thread only if the problem was temporary.
In case of persistent problem we don't want to loop forever.
MFC after: 3 days
Modified:
head/sbin/hastd/hastd.c
Modified: head/sbin/hastd/hastd.c
==============================================================================
--- head/sbin/hastd/hastd.c Wed Apr 28 22:39:47 2010 (r207347)
+++ head/sbin/hastd/hastd.c Wed Apr 28 22:41:06 2010 (r207348)
@@ -140,9 +140,15 @@ child_exit(void)
proto_close(res->hr_ctrl);
res->hr_workerpid = 0;
if (res->hr_role == HAST_ROLE_PRIMARY) {
- sleep(1);
- pjdlog_info("Restarting worker process.");
- hastd_primary(res);
+ if (WEXITSTATUS(status) == EX_TEMPFAIL) {
+ sleep(1);
+ pjdlog_info("Restarting worker process.");
+ hastd_primary(res);
+ } else {
+ res->hr_role = HAST_ROLE_INIT;
+ pjdlog_info("Changing resource role back to %s.",
+ role2str(res->hr_role));
+ }
}
pjdlog_prefix_set("%s", "");
}
More information about the svn-src-all
mailing list