Project

General

Profile

Actions

Bug #5304

closed

syseventd: datalink notify thread hangs up when terminated

Added by Tao Xu over 6 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2014-11-10
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

When syseventd is terminated or restarted by svcadm, sometimes it will get stuck in waiting for exit of datalink notify thread.

It's found that the mutex and conditional variable are initialized after thread creation. If datalink notify thread runs into cond_wait() before initialization, it won't be waked up by cond_signal(). Then syseventd can't be stopped or restarted until force kill.

https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/syseventd/modules/datalink_mod/datalink_mod.c#L173

    if (thr_create(NULL, 0,  datalink_notify_thread, NULL, 0,
        &dl_notify_tid) != 0) {
        (void) rcm_free_handle(rcm_hdl);
        return (NULL);
    }

    (void) mutex_init(&dl_mx, USYNC_THREAD, NULL);
    (void) cond_init(&dl_cv, USYNC_THREAD, NULL);
Actions

Also available in: Atom PDF