Random.org scheduled task deadlocks #17
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: bea/HidekoBot#17
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue #16 is caused by one of the runnables in the pool getting stuck doing something, and never finishing, thus impeding other scheduled threads from running. This is why Trivia questions are never sent, because the task gets queued but never gets a chance to run.
Some scheduled task deadlocksto Random.org scheduled task deadlocksUpdate: the task that hangs is the random.org seed updater. It hangs while trying to create the new Random object, probably due to API or connectivity issues. A fix is on its way that will cancel the task after a specified timeout and handle the Random initialization.
Potential side effects: even if we set the timeout to 60 seconds, this means that in that timeframe, no other scheduled task (from the same executor) will run. This also means that for example, it could take up to a full minute for the first Trivia question to get sent. We probably need to use different executors for system/user features and tasks or use more threads.
We also initialize random.org at startup. We should probably performe the dealock-checking inside of the "initialize" method instead of the scheduled task, because it could happen in other places too. But this also means that it would be an async method. A better approach would be to simply rely on the scheduler instead of initializing it manually at startup too.