Skip to content

Conversation

@SuperFluffy
Copy link
Contributor

@SuperFluffy SuperFluffy commented Jan 21, 2025

Summary

Removes a panic source in the conductor frontend by moving around the restart logic.

Background

Conductor::run_until_stopped contains a loop to allow restarting its backend business logic. This loop delegates to a Conductor::restart_or_shutdown method to execute the restart of the backend, and then immediately reenters the loop no matter a restart happened or not.

While refactoring the inner conductor business logic (which lead to slightly different return values in turn affecting the blackbox test assertions) it was found that behavior can lead to the conductor backend panicking because it's being polled again even after running to completion.

Changes

  • Rename Conductor::shutdown_or_restart to Conductor::restart_or_shutdown to match the enum it's branching on.
  • Execute the restart inside the frontend loop to not reentering it, avoiding to poll the already completed backend task.

Testing

This can't really be tested. But it does fix the panic in the refactor PR.

Changelogs

Changelogs updated.

@github-actions github-actions bot added the conductor pertaining to the astria-conductor crate label Jan 21, 2025
@SuperFluffy SuperFluffy force-pushed the superfluffy/fix-conductor-restart branch from bb39173 to a83f3ee Compare January 21, 2025 15:17
@SuperFluffy SuperFluffy marked this pull request as ready for review January 24, 2025 14:08
@SuperFluffy SuperFluffy requested a review from a team as a code owner January 24, 2025 14:08
@SuperFluffy SuperFluffy requested a review from Fraser999 January 24, 2025 14:08
@SuperFluffy SuperFluffy added this pull request to the merge queue Feb 3, 2025
Merged via the queue into main with commit 141988f Feb 3, 2025
97 of 99 checks passed
@SuperFluffy SuperFluffy deleted the superfluffy/fix-conductor-restart branch February 3, 2025 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conductor pertaining to the astria-conductor crate override-freeze

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants