forked from SWISDATA/processintel
mining.genetic: a genetic run cancels the runs of other users and tabs #3
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#3
Loading…
Reference in a new issue
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?
Severity: critical (on the hosted service, one user's run silently cancels another user's run)
Where
app/mining_algorithms/genetic_mining.py:28-29,:110-113,:160-166,:342-350Problem
GeneticMiningcancels running evolutions through class-level state:Every call to
generate_graphoverwritesGeneticMining._global_current_run_idwith a new UUID. Each running evolution loop checks once per generation whether the global ID still matches its own and stops if not. After the loop,generate_graphalso returns without building a graph if the IDs differ.Streamlit serves all browser sessions from the same Python process, so this "global" ID is shared by all users and all tabs.
Steps to reproduce
Expected behavior
Both runs complete independently and each tab shows its own model.
Actual behavior
The run in tab A stops at the next generation boundary and
self.graphis not updated (Noneon the first run, otherwise the previous graph). Tab A shows no error, only the info box "Please adjust the Genetic Mining settings…" or a stale model that does not match the parameters. Becausererun_genetic_mineris reset, user A has to click Run again, which in turn cancels B's run.Related: #54.
Fix
Make cancellation per session: keep the run ID / cancellation token on the model instance (or in
st.session_state) and checkself._current_run_idinstead of the class attribute. Longer term, run long computations in a managed worker with explicit cancellation (#54).from
issues/BUG-003-genetic-miner-global-run-id-cancels-other-users.md(code analysis of commit6bcc646, 2026-10-03)