#490 Reactor / Observer bug when scaling

Platform_Specific
closed
nobody
Net (141)
5
2012-09-14
2011-12-31
Anonymous
No

Dear Poco maintainers,

I have been testing SocketReactor scalability and have come across some interesting behavior running on a windows XP machine.
When simultaneously connecting multiple clients (issue occurs after ~60) the ServiceHandler simply stops receiving callbacks.
I have tracked the issue all the way to the Observer callback method:
(_pObject->_method)(pCastNf);
which is not calling the appropriate class method ie. void onReadable(ReadableNotification
pNf)
The same thing happens when I attempt to call a direct method on the ServiceHandler from the observer.

Note that the reactor is running in a separate thread, and I am using the test EchoServiceHandler so no thread locking is used. This is not a deadlock situation.

In the mean time I have implemented my own reactor which used async callbacks using my own callback code and no such problems arise. Note that async callbacks also significantly improve the reactor performance, is that something that might be considered for Poco?

I have never experienced such behavior, but no doubt you are much more experienced programmers than I. Perhaps you can explain / fix it?

Discussion

  • Yuki Izayoi
    Yuki Izayoi
    2011-12-31

    I think the reason of your bug is the windows xp select io model only support max 64 sockets.Poco need to provide some scalable asio solution for windows such as proactor.
    For Linux,Poco 's reactor use epoll to emulate the select and the performance is not good because of recreate epoll handle and insert sockets every time when you call the select function.

     
  • James Mansion
    James Mansion
    2012-01-01

    That is not true - the default value for FD_SETSIZE is 64. You can change it - read the documentation on select.

     
  • Here's the Microsoft statement on that issue: http://support.microsoft.com/kb/111855.
    Closing this because it's not really a bug and there's also a feature request regarding this.