You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++] Potential race condition in readahead generator #33201
It is possible for the final future to get marked finished twice.
Thread 1: Polls the generator, checks finished (false), is about to add a task
Thread 2: Finishes, marks finished, decrements running tasks to 0
Thread 1: adds task, immediately finishes, decrements running tasks to 0
Both threads will attempt to mark the final future finished.
This appears to have been fixed in #45954, which describes the samenterleaving: finished and num_running in ReadaheadGenerator are now updated under a single mutex, so the check and the increment can no longer be separated. Closing.
Activity
asfimport commentedon Oct 12, 2022
Weston Pace / @westonpace:
This commit demonstrates the problem fairly easily (if running stress): master...westonpace:arrow:bugfix/ARROW-17996--race-condition-in-readahead-generator
thisisnic commentedon Nov 19, 2026
This appears to have been fixed in #45954, which describes the samenterleaving:
finishedandnum_runninginReadaheadGeneratorare now updated under a single mutex, so the check and the increment can no longer be separated. Closing.