Project

General

Profile

Bug #5304

syseventd: datalink notify thread hangs up when terminated

Added by Tao Xu almost 5 years ago. Updated about 3 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:

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);

History

#1

Updated by Yuri Pankov about 3 years ago

  • Status changed from New to Pending RTI
  • Assignee set to Yuri Pankov
  • % Done changed from 0 to 90
  • Tags deleted (needs-triage)
#2

Updated by Electric Monk about 3 years ago

  • Status changed from Pending RTI to Closed
  • % Done changed from 90 to 100

git commit 0756cc7034e080027082817163d21e36e93310ed

commit  0756cc7034e080027082817163d21e36e93310ed
Author: Yuri Pankov <yuri.pankov@nexenta.com>
Date:   2016-09-06T18:24:03.000Z

    5304 syseventd: datalink notify thread hangs up when terminated
    Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
    Reviewed by: Dan Fields <dan.fields@nexenta.com>
    Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF