Skip to content

fix: call deduplicateCallback on topics deletion error#323

Merged
ShogunPanda merged 1 commit into
platformatic:mainfrom
kjamrog:fix-delete-topics-error-handling
Jun 22, 2026
Merged

fix: call deduplicateCallback on topics deletion error#323
ShogunPanda merged 1 commit into
platformatic:mainfrom
kjamrog:fix-delete-topics-error-handling

Conversation

@kjamrog

@kjamrog kjamrog commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

Fix the error path of Admin#deleteTopics to call deduplicateCallback instead of the raw callback.

Why

On error, #deleteTopics invoked the outer callback directly and never called deduplicateCallback. Because kPerformDeduplicated only clears its in-flight entry (and flushes queued callers) when that completion callback fires, a failed deleteTopics left a stale entry in the deduplication cache. As a result, any subsequent deleteTopics for the same topic set on the same Admin instance would be queued forever and never resolve — and concurrent duplicate callers would hang on the first failure too.

A common trigger is deleting a non-existent topic (e.g. test cleanup): the first call errors and poisons the cache, so every later call hangs.

This aligns #deleteTopics with #createTopics, which already calls deduplicateCallback(new MultipleErrors(...)) on error.

Consequences

  • Dedup cache is reset on failure, so retries/subsequent calls work instead of hanging.
  • All deduplicated callers reject with the same error rather than hanging.
  • Single-call error output is unchanged (MultipleErrors('Deleting topics failed.', [error])); existing tests still pass.

Test

Adds a regression test asserting that a second deleteTopics for the same topics still rejects (rather than hangs) after a prior failure.

Signed-off-by: Krzysztof Jamrog <krzysztof.jamrog@lokalise.com>
@kjamrog kjamrog changed the title Fixed error handling on topics deletion fix: call deduplicateCallback on topics deletion error Jun 18, 2026
@ShogunPanda ShogunPanda merged commit e18a875 into platformatic:main Jun 22, 2026
25 checks passed
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.

2 participants