You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MicroVM worker: the unknown-outcome warning and its refusal are decided in two locked blocks #820
For an unknown outcome of the worker's own SuspendMicrovm call, the Python worker chooses the warning text and the 30-second refusal in two separate locked blocks. An event between them can make the logged text false.
Details
The decision block in _call_suspend reads _suspending under the lock, and chooses the warning text from it.
For an unknown outcome, that block changes no state.
The worker then releases the lock, writes the warning, and closes the client if it owns it.
A second locked block then reads _suspending again. It starts the 30-second refusal only if _suspending is still set.
A suspend hook's 30 seconds can end between the two reads. The grace timer then clears _suspending.
A review probe did this. The worker logged "The worker refuses jobs until the MicroVM resumes, or for 30 seconds." A job sent right after the warning got HTTP 202.
The behavior is correct: the hook's 30 seconds ended, so the worker accepts jobs. Only the log line is false.
The window lasts as long as the log write and client.close() take. That is a few milliseconds with a fast log sink.
The JavaScript worker has no such window. It logs, destroys the client, and checks suspending without an await in between.
The comment in the decision block says the text matches the decision. For an unknown outcome, the decision is in the second block. So the comment is true only for a rejection and a refusal for now.
For an unknown outcome, start the 30-second refusal inside the decision block when _suspending is set, and skip the second block for that outcome. The success path still needs the second block. The 30 seconds would then start before client.close() instead of after it.
Activity
fix(microvm-worker): state when the call repeats
fix(microvm-worker): state that the refusal ended (#817)
refactor(microvm-worker): log one suspend warning (aws#831)