Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
proton-0.11.0
-
Windows
Description
I added a new reactor test that exercises the python-proton ApplicationEvent and EventInjector classes:
proton_tests.reactor.ApplicationEventTest.test_application_events
See tests/python/proton_tests/reactor.py
This test passes on linux, but hangs when run on Windows.
Poking around a bit, I suspect the problem may be in the Windows selector code. Description:
The EventInjector/ApplicationEvent classes provide a way to trigger events from threads external to the reactor main loop. See proton-c/bindings/python/proton/reactor.py. A pipe is used to wake up the reactor when a new event is sent to the reactor (see reactor.py in the python bindings). The EventInjector's trigger method puts the event on a queue and writes to a pipe to wake up the reactor. The on_selectable_readable callback in the EventInjector is called on the reactor thread to get the event off the queue and clear the pipe.
On windows it appears as if the EventInjector selectable is made "readable" even though nothing has been written to the pipe. This causes the os.read() call in the on_selectable_readable() callback to hang.
Best I can tell the windows selector code doesn't work properly with a pipe. The pn_selector_next() function is returning a read event on the pipe's read descriptor even though the pipe is empty. But I'm not familiar with the window's selector implementation, so this is a best guess.
Attachments
Issue Links
- relates to
-
PROTON-1692 External selectable does not work on Windows
- Open