zanmato1984 commented on code in PR #48742: URL: https://github.com/apache/arrow/pull/48742#discussion_r2670754008
########## cpp/src/arrow/csv/reader.cc: ########## Review Comment: Sorry I have to double check the deadlock reasoning. Seems that `self` is well captured by the returned future. So the deadlock happens only when: 1) early error happens and `FinishAsync()` is skipped; 2) the returned future is marked finished (by error) and released in its owning thread (the "main" thread), `self` ref count decreased but not to `0` (because of); 3) some task in the task group is still running, and the task holds a strong ref to `self` captured in `block_visitor` (so far the task group, tasks, and the `self` it owned are fully detached from the main thread?); 4) as the remaining tasks finish, `self` ref count goes to `0` and invokes the `AsyncThreadedTableReader` dtor, which in turn drains the task group in which the dtor is being invoked - deadlock? If my understanding is correct, it doesn't seem that we have ownership issues: * If no error, then the main thread owns the future, which owns `self`, until all tasks are finished. * If early error, then the tasks own `self`. * `self` owns all the things: options, task group. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
