PySCXML
PySCXML copied to clipboard
Dropped Events
When doing sends right after each other, the second event might be ignored. Problem does not happen when sleeping between sends.
See https://gist.github.com/fabb/5014867
Python 2.7, Win 7 64bit, PySCXML 0.8.3 if it helps.
Strange, it only happens when executing the module with Eclipse PyDev. In the windows console, it always works fine.
Flushing stderr also won't help. Any other idea what might go wrong?
hm, odd. i've never come across the issue, and I develop pyscxml using pydev. not on windows, however, so can't really help you there... if you figure it out, be sure to let us know!
Some more I found out:
The second event is not dropped, it sits unprocessed in the StateMachine's interpreter.externalQueue.queue.
When I call eventlet.greenthread.sleep()
in the end of my client program, the event gets processed fine.
More info:
In the first send event, due to eventlet.greenthread.sleep()
the interpreter's mainEventLoop is waken up (from sleep in line 97), processes the event, and sleeps again at the same line. Everything fine.
In the second event, eventlet.greenthread.sleep()
is called, but the interpreter's mainEventLoop is NOT waken up.
It seems as the method of using eventlet.greenthread.sleep()
to signal the mainEventLoop to continue running is not guaranteeing a deterministic execution.
Thanks, I'll have a closer look.