Skip to content

fix(experiments): close the experiment.log file handler after a run - #438

Open
JYunth wants to merge 1 commit into
ServiceNow:mainfrom
JYunth:fix/close-experiment-log-handler
Open

JYunth wants to merge 1 commit into
ServiceNow:mainfrom
JYunth:fix/close-experiment-log-handler

Conversation

@JYunth

@JYunth JYunth commented Nov 29, 2026

Copy link
Copy Markdown

ExpArgs._unset_logger removes the experiment.log FileHandler from the root logger but never closes it, so every experiment run in the same process leaves that file open. Running 5 experiments in one process leaves 5 open handles; with this change there are none. Long-lived workers that run many experiments can eventually hit the open-file limit.

One-line fix, plus test_run_exp_releases_log_file in tests/experiments/test_exp_loop.py, which fails on main.

ExpArgs._unset_logger removed the FileHandler from the root logger but never
closed it, so every experiment run in the same process left its
experiment.log file open. Long-lived workers that run many experiments
leak one file descriptor per run.

Close the handler after removing it.

This branch has not been deployed

No deployments
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