chore: fix random/grid searcher bug with max_concurrent_trials #4836
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This change fixes a bug where, if trials exited early under the grid or random searchers when using
max_concurrent_trials
, it would cause double the amount of trials to be spawned in its place, exceeding max concurrent trials. This was caused by the searcher hooking into both 'trial exited early' and 'trial closed' events as notification a trial had closed when 'trial closed' is already emitted for every trial ('trial exited early' is just an additive event for failed and invalid HP trials).Test Plan
Commentary (optional)
Checklist
docs/release-notes/
.See Release Note for details.
/webui/react/src/shared/
verifymake -C webui/react test-shared
passes.