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
bug(spark): wait_for_job_status still uses a mutable default set, not covered by #330/#393/#874 #885
This is the same anti-pattern reported in #329, but #329 and both of its open fix PRs (#330, #393) only touch the Trainer and Optimizer modules (optimizer/api/optimizer_client.py, optimizer/backends/*, trainer/api/trainer_client.py, trainer/backends/*) — the Spark module isn't in either diff. #874 ("validate requested job statuses") also edits these same three Spark files but only adds validation inside the function body; it doesn't touch the default-argument line either, so the mutable default survives that change too.
Minimal repro, showing the default set object is created once and shared across every call that doesn't pass status explicitly:
Once any code mutates the shared default set in place (e.g. a caller builds on the default with status.add(...) instead of copying it first), every subsequent call to that method made without an explicit status argument silently treats the mutated set as its target state(s), for the lifetime of the process.
What did you expect to happen?
Following the same fix already agreed for #329: default to None and assign a fresh {SparkJobStatus.COMPLETED} inside the function body, so each call gets an independent set, in all three Spark signatures.
Closing this off taking precedent from #320 and #751.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Activity
SAURABHSALVE commentedon Oct 20, 2026
/assign
tariq-hasan commentedon Oct 25, 2026
Closing this off taking precedent from #320 and #751.
/close
google-oss-prow commentedon Oct 25, 2026
@tariq-hasan: Closing this issue.
Details
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.