Random.org scheduled task deadlocks #17

Open
opened 2023-01-24 14:30:11 +01:00 by bea · 2 comments
Owner

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.

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.
bea added the
bug
label 2023-01-24 14:30:11 +01:00
bea changed title from Some scheduled task deadlocks to Random.org scheduled task deadlocks 2023-01-25 20:32:50 +01:00
Author
Owner

Update: 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.

Update: 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.
Author
Owner

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.

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.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: bea/HidekoBot#17
No description provided.