-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
I have found a bug in SocketReactor for Linux. This is relevant for v1.10.1.
Steps to reproduce:
- Create and run the reactor.
- Create a socket and connect to a remote host.
- Subscribe to various types of events by using SocketReactor::addEventHandler() method. For example: ReadableNotification, WritableNotification and TimeoutNotification.
- Send some data to the socket.
- Wait for the WritableNotification event and unsubscribe from this event by using SocketReactor::removeEventHandler() method.
Voila!
It happened because your forgot to update _pollSet and remove the corresponding epoll event. As a result, _pollSet.poll() immediately returns with an event that doesn't have handle (in this example PollSet::POLL_WRITE). This happens over and over without any delay and loads the processor.
I have provided you with a simple fix for this error.
Let me know if I was wrong. Thanks
Reactions are currently unavailable