As mentioned in https://github.com/romange/helio/pull/111, shutdown doesn't seem to wake up the socket accept fiber (can't find any reference to this but running locally getting the same behaviour, wheras epoll is woken)
With this the accept server tests pass ok as the accept fiber no longer blocks on tear down (theres some other failures on MacOS but they seem unrelatex)
This seemed simpler than using EVFILT_USER since AFAICT the trigger must include the centries_ index, which the socket doesn't know, and it requires calling back to the proactor, which notifies the kqueue, which calls Wakey, so seemed easier just to call directly? It is still a bit hacky - the #ifndef __linux__ is probably redundant but figured better to include to be safe
As mentioned in https://github.com/romange/helio/pull/111,
shutdown
doesn't seem to wake up the socket accept fiber (can't find any reference to this but running locally getting the same behaviour, wherasepoll
is woken)With this the accept server tests pass ok as the accept fiber no longer blocks on tear down (theres some other failures on MacOS but they seem unrelatex)
This seemed simpler than using
EVFILT_USER
since AFAICT the trigger must include thecentries_
index, which the socket doesn't know, and it requires calling back to the proactor, which notifies the kqueue, which callsWakey
, so seemed easier just to call directly? It is still a bit hacky - the#ifndef __linux__
is probably redundant but figured better to include to be safe