Skip to content

Commit

Permalink
datalake: opt out of stop_translator when stopping
Browse files Browse the repository at this point in the history
Previously stop_translator() seemed to allow erased translators to go
un-stopped if the datalake_manager's gate is closed. This commit adds an
early return to avoid this.

It's not clear that this is actually problematic in practice because the
notification deregistration and gate close should happen atomically in
stop(), so it seems like notifications _should_ be guaranteed to run
without thinking about the gate. But it's an easy enough check to add
in.
  • Loading branch information
andrwng committed Dec 13, 2024
1 parent ad8a5b0 commit 44354fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/v/datalake/datalake_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ void datalake_manager::start_translator(
}

void datalake_manager::stop_translator(const model::ntp& ntp) {
if (_gate.is_closed()) {
// Cleanup should be deferred to stop().
return;
}
auto it = _translators.find(ntp);
if (it == _translators.end()) {
return;
Expand Down

0 comments on commit 44354fb

Please sign in to comment.