Skip to content

Conversation

kfindeisen
Copy link
Member

@kfindeisen kfindeisen commented Oct 8, 2025

This PR tests various ways to interrupt Prompt Processing on a timer.

Now that activator.py is an importable module, and not an executable,
it should list the members intended to be imported elsewhere.
The GracefulShutdownInterrupt and generic error handlers were identical
except for one line. It's easier (if slightly slower?) to use an
explicit isinstance check than to maintain two different handlers.
This lets the worker be called with a timeout, with the timeout's
implementation details hidden from process_visit's clients.
It is possible (but unlikely) that the execution framework can fail in
a way that's impossible to recover from, and prevents processing any
more visits. This case is now handled correctly by the driver.
The timeout uses a ProcessPoolExecutor that's kept alive as long as
possible, and rebooted if it starts raising BrokenProcessPool.
Unfortunately, the fact that the two standard pools *can* break leaks
out of the process_visit implementation despite attempts to handle it
internally.
@kfindeisen kfindeisen marked this pull request as draft October 10, 2025 20:51
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.

1 participant