redpanda-data / redpanda

Redpanda is a streaming data platform for developers. Kafka API compatible. 10x faster. No ZooKeeper. No JVM!
https://redpanda.com
9.17k stars 561 forks source link

task_local_ptr may survive through scheduling points #18421

Closed bashtanov closed 1 month ago

bashtanov commented 1 month ago

Version & Environment

Purely theoretical reasoning, applies to dev as of dc76d1a9b5

What went wrong?

task_local_ptr may survive through scheduling points, as it relies on comparing pointers to tasks here, and there is a chance a new task is located at the same memory address as the original one.

What should have happened instead?

It should be reliable. Comparing seastar::engine::tasks_processed() instead is my idea on how I would fix it.

How to reproduce the issue?

I have not seen the issue in the wild. I would create unit test to stress test it.

JIRA Link: CORE-2928

nvartolomei commented 1 month ago

@Lazin

dotnwat commented 1 month ago

@bashtanov cool observation. is the implication of this that we rely on the task local pointer to be unique because it's used to do something like index into a data store?

bashtanov commented 1 month ago

@dotnwat I'm not sure I understand your question. Could you rephrase please?