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

Fix for hanging on quit (fixes issues #4 and #21 ) #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Miffyli
Copy link

@Miffyli Miffyli commented Mar 26, 2017

Processes/threads got stuck in queue.get() operations which normally block indefinitely. This commit adds timeouts with required checks to quit when exit_flags are set to True.
Added exit_flag for ProcessStats.
Added long timeout for receiving prediction in ProcessAgent. I don't see why this hangs at times but during tests there were rare cases where this part hanged.

The code "overshoots" the number of episodes defined in Config before closing. With EPISODES=10 my run reaches ~60 episodes before closing.

Edit: Actually this could be made better by using multiprocessing.Queue.close. It would still require try-excepts but would avoid using get every 0.001 seconds.

…get() operations, added exit_flag for ProcessStats
…prediction_q. These seemed to cause rare occasions where joining processes hanged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant