Clone
Julien Viet
committed
on 01 May 19
KQueueEventLoop won't unregister active channels reusing a file descriptor
Motivation:

The current KQueueEventLoop implementation does not … Show more
KQueueEventLoop won't unregister active channels reusing a file descriptor

Motivation:

The current KQueueEventLoop implementation does not process concurrent domain socket channel registration/unregistration in the order they actual

happen since unregistration are delated by an event loop task scheduling. When a domain socket is closed, it's file descriptor might be reused

quickly and therefore trigger a new channel registration using the same descriptor.

Consequently the KQueueEventLoop#add(AbstractKQueueChannel) method will overwrite the current inactive channels having the same descriptor

and the delayed KQueueEventLoop#remove(AbstractKQueueChannel) will remove the active channel that replaced the inactive one.

As active channels are registered, events for this file descriptor won't be processed anymore and the channels will never be closed.

Modifications:

Change the logic of KQueueEventLoop#remove(AbstractKQueueChannel) channels so it will check channels equality prior removal.

Result:

KQueueEventLoop won't remove anymore active channels reusing a file descriptor.

Show less