Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropped Events #3

Open
fabb opened this issue Feb 22, 2013 · 5 comments
Open

Dropped Events #3

fabb opened this issue Feb 22, 2013 · 5 comments
Labels

Comments

@fabb
Copy link

fabb commented Feb 22, 2013

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

@fabb
Copy link
Author

fabb commented Feb 23, 2013

Python 2.7, Win 7 64bit, PySCXML 0.8.3 if it helps.

@fabb
Copy link
Author

fabb commented Feb 23, 2013

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?

@jroxendal
Copy link
Owner

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!

@fabb
Copy link
Author

fabb commented Feb 28, 2013

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.

@jroxendal
Copy link
Owner

Thanks, I'll have a closer look.

@jroxendal jroxendal reopened this Feb 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants