Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transform: prevent double processor starts #15933

Merged
merged 2 commits into from
Jan 4, 2024

Conversation

rockwotj
Copy link
Contributor

@rockwotj rockwotj commented Jan 3, 2024

It's possible to get a double start of the processor if the wasm VM immediately stops, as we check to see if the task is running in the manager to decide if we start a processor or not. Fix that by correcting the predicate to be "have I called start without calling stop". Since the consequence of messing up reference counting is a crash, I've also added another cautionary check to start to prevent double starts.

I will followup with some ducktape tests around failing modules to hopefully check this kind of thing in the future.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x
  • v23.1.x

Release Notes

Bug Fixes

  • Prevent an assertion from being triggered when Wasm VMs fail immediately.

@rockwotj rockwotj self-assigned this Jan 3, 2024
@rockwotj rockwotj added this to the v23.3.x-next milestone Jan 3, 2024
There is an edge case when the wasm VM immediately halts that we can get
double starts because the task is "failed", but that can cause something
else to come along in `transform::manager::start_processor` and start it
again, which messes up our ref counting in the shared wasm engine.

Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
Double starts can mess up our ref counting as seen in the previous
commit. Guard against this in the future by mirroring stop and checking
the abort source.

Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
@rockwotj rockwotj merged commit 5f4b277 into redpanda-data:dev Jan 4, 2024
19 checks passed
@rockwotj rockwotj deleted the ref-counting-sucks branch January 4, 2024 00:21
@vbotbuildovich
Copy link
Collaborator

/backport v23.3.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants