Permalink
Browse files

Fix random ztest_deadman_thread failures

The zloop test has been failing in buildbot for the last few weeks
with various failures in ztest_deadman_thread(). This is due to the
fact that this thread is not stopped when performing pool import /
export tests as it should be. This patch simply corrects this.

TEST_ZTEST_TIMEOUT=3600

Signed-off-by: Tom Caputi <tcaputi@datto.com>
  • Loading branch information...
tcaputi committed Oct 10, 2018
1 parent 5b3bfd8 commit dc5aba87cd462276a5d140bbe58e867cbc0192f6
Showing with 6 additions and 3 deletions.
  1. +6 −3 cmd/ztest/ztest.c
View
@@ -6654,7 +6654,7 @@ ztest_deadman_thread(void *arg)
spa_t *spa = ztest_spa;
hrtime_t delta, overdue, total = 0;
for (;;) {
while (!ztest_exiting) {
delta = zs->zs_thread_stop - zs->zs_thread_start +
MSEC2NSEC(zfs_deadman_synctime_ms);
@@ -6688,6 +6688,8 @@ ztest_deadman_thread(void *arg)
(void) printf("ztest has been running for %lld seconds\n",
total);
}
thread_exit();
}
static void
@@ -6881,7 +6883,7 @@ ztest_run(ztest_shared_t *zs)
{
spa_t *spa;
objset_t *os;
kthread_t *resume_thread;
kthread_t *resume_thread, *deadman_thread;
kthread_t **run_threads;
uint64_t object;
int error;
@@ -6939,7 +6941,7 @@ ztest_run(ztest_shared_t *zs)
/*
* Create a deadman thread and set to panic if we hang.
*/
(void) thread_create(NULL, 0, ztest_deadman_thread,
deadman_thread = thread_create(NULL, 0, ztest_deadman_thread,
zs, 0, NULL, TS_RUN | TS_JOINABLE, defclsyspri);
spa->spa_deadman_failmode = ZIO_FAILURE_MODE_PANIC;
@@ -7009,6 +7011,7 @@ ztest_run(ztest_shared_t *zs)
/* Kill the resume thread */
ztest_exiting = B_TRUE;
VERIFY0(thread_join(resume_thread));
VERIFY0(thread_join(deadman_thread));
ztest_resume(spa);
/*

0 comments on commit dc5aba8

Please sign in to comment.