Skip to content

Conversation

@seddonm1
Copy link
Contributor

@seddonm1 seddonm1 commented Mar 1, 2021

@alamb

This is the test that was hanging without tokio::task::yield_now().await; so we should incorporate it for any future changes.

@github-actions
Copy link

github-actions bot commented Mar 1, 2021

Ok(output_partitions)
}

#[tokio::test(flavor = "multi_thread")]
Copy link
Contributor

@alamb alamb Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @seddonm1 -- as you say this test hangs when I comment out the call to

tokio::task::yield_now().await;

@alamb
Copy link
Contributor

alamb commented Mar 3, 2021

Incorporated in #9605 so closing this PR

@alamb alamb closed this Mar 3, 2021
alamb added a commit that referenced this pull request Mar 3, 2021
…void potential deadlocks

# Rationale

As spotted / articulated by @edrevo #9523 (comment), the intermixing of `crossbeam` channels (not designed for `async` and can block task threads) and `async` code such as DataFusion can lead to deadlock.

At least one of the crossbeam uses predates DataFusion being async (e.g. the one in the parquet reader). The use of crossbeam in the repartition operator in #8982 may have resulted from the re-use of the same pattern.

# Changes

1. Removes the use of crossbeam channels from DataFusion (in `RepartitionExec` and `ParquetExec`) and replace with tokio channels (which are designed for single threaded code).
2. Removes `crossbeam` dependency entirely
3. Removes use of `multi_thread`ed executor in tests (e.g. `#[tokio::test(flavor = "multi_thread")]`) which can mask hangs

# Kudos / Thanks

This PR incorporates the work of @seddonm1 from #9603 and @edrevo in  https://github.com/edrevo/arrow/tree/remove-crossbeam (namely 97c256c4f76b8185311f36a7b27e317588904a3a). A big thanks to both of them for their help in this endeavor.

Closes #9605 from alamb/alamb/remove_hang

Lead-authored-by: Ximo Guanter <ximo.guanter@gmail.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: Mike Seddon <seddonm1@gmail.com>
Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
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.

2 participants