Skip to content

v1.2.36

@liukun liukun tagged this 08 Nov 08:59
Watch used to queue the fd and let the poller goroutine apply EV_ADD on
its next kevent call. By then the watcher may already have closed the
descriptor, or the number may have been reused by an unrelated file. On
macOS a kevent referencing a descriptor that is concurrently being
closed can block close(2) forever in the kernel (fpdrain), leaving the
test process unkillable.

Apply EV_ADD|EV_CLEAR immediately under p.mu, mirroring Unwatch, and
drop the watchQueue. Add a regression test asserting the filters are
registered before Watch returns.
Assets 2
Loading