Xin Chen created PROTON-1692:
--------------------------------
Summary: External selectable does not work on Windows
Key: PROTON-1692
URL: https://issues.apache.org/jira/browse/PROTON-1692
Project: Qpid Proton
Issue Type: Bug
Components: proton-c
Affects Versions: proton-c-0.18.1
Environment: Windows
Reporter: Xin Chen
Attachments: proton-c.patch
In Python binding the built-in EventInjector does not work on Windows.
https://issues.apache.org/jira/browse/PROTON-1071
So I needed to implement one using a socket pair. I can set one socket as
selectable on reactor. The on_selectable_init and on_selectable_readable events
are filed once correctly when I trigger an event by sending a byte to the
selectable socket. The problem is that the on_selectable_readable event is
fired again without any triggering bytes. When i do a recv call on the socket,
reactor hangs because there is no data available to read.
The problem happens because how selectables are implemented on Windows. The
selectable handles are bound to the iocp and readable events are generated when
the zero-byte read completes. This works for internal handles because
pni_iocp_recv is called to get data and a new begin_zero_byte_read is issued
after the recv call. For external selectable the recv call is made outside of
protoc-c engine so no more read call is issued. in selector.c the
triggered_list_head is not cleared and the event loop will fire the same event
again. I didn't find a good way to fix this, and end up with a workaround by
using pn_selector_update to generate a read loop on the socket. See the
attached patch for the workaround.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]