Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Calculate the actual mask to be removed in the eventloop before aeApi…
…DelEvent (valkey-io#725) for kqueue: EV_DELETE fails if the specified fd is not associated with the kqfd. If EVFILT_WRITE is associated but EVFILT_READ is not, then calling aeApiDelEvent with mask = -1 or `(AE_READABLE|AE_WRITABLE)` will cause the kevent() to fail with errno = 2(No such file or directory) and EVFILT_WRITE not dissociated. So we need to calculate the actual mask to be removed, instead of passing in whatever user provides. for evport: The comment clearly states that aeApiDelEvent "rely on the fact that our caller has already updated the mask in the eventLoop". for epoll: There's no need to calculate the "actual mask" twice, once in `aeDeleteFileEvent` and another in `aeApiDelEvent`, let's just use the mask recorded in the eventLoop. Fixes valkey-io#715 Signed-off-by: wkgcass <[email protected]> Co-authored-by: Andy Pan <[email protected]> Co-authored-by: Binbin <[email protected]>
- Loading branch information