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

Removes all usage of block_on, and use a oneshot channel instead. #1315

Merged
merged 5 commits into from
Mar 18, 2022

Conversation

fulmicoton
Copy link
Collaborator

Calling block_on panics in certain context.
For instance, it panics when it is called in a the context of another
call to block.

Using it in tantivy is unnecessary. We replace it by a thin wrapper
around a oneshot channel that supports both async/sync.

@fulmicoton fulmicoton force-pushed the remove-block-on branch 2 times, most recently from 8674eca to 31166a1 Compare March 17, 2022 12:26
@fulmicoton fulmicoton marked this pull request as draft March 17, 2022 12:26
@fulmicoton fulmicoton force-pushed the remove-block-on branch 4 times, most recently from 0d348e3 to 64557a4 Compare March 18, 2022 01:54
@fulmicoton fulmicoton marked this pull request as ready for review March 18, 2022 01:55
Calling `block_on` panics in certain context.
For instance, it panics when it is called in a the context of another
call to block.

Using it in tantivy is unnecessary. We replace it by a thin wrapper
around a oneshot channel that supports both async/sync.

Closes #898
@fulmicoton fulmicoton force-pushed the remove-block-on branch 3 times, most recently from 0f55152 to 10c6386 Compare March 18, 2022 03:03
@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2022

Codecov Report

Merging #1315 (a51f15d) into main (958b2be) will increase coverage by 0.21%.
The diff coverage is 89.89%.

❗ Current head a51f15d differs from pull request most recent head c7cb458. Consider uploading reports for the commit c7cb458 to get more accurate results

@@            Coverage Diff             @@
##             main    #1315      +/-   ##
==========================================
+ Coverage   94.04%   94.26%   +0.21%     
==========================================
  Files         230      232       +2     
  Lines       39384    40800    +1416     
==========================================
+ Hits        37040    38461    +1421     
+ Misses       2344     2339       -5     
Impacted Files Coverage Δ
src/query/term_query/term_scorer.rs 74.49% <0.00%> (+0.59%) ⬆️
src/indexer/index_writer.rs 96.74% <50.00%> (-0.18%) ⬇️
src/indexer/segment_updater.rs 94.88% <83.01%> (+0.32%) ⬆️
src/future_result.rs 94.11% <94.11%> (ø)
src/aggregation/mod.rs 98.53% <100.00%> (+0.56%) ⬆️
src/core/index.rs 93.89% <100.00%> (-0.04%) ⬇️
src/directory/file_watcher.rs 100.00% <100.00%> (ø)
src/directory/tests.rs 99.09% <100.00%> (ø)
src/directory/watch_event_router.rs 95.79% <100.00%> (-0.36%) ⬇️
src/fastfield/mod.rs 92.93% <100.00%> (-0.02%) ⬇️
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 958b2be...c7cb458. Read the comment docs.

src/indexer/segment_updater.rs Show resolved Hide resolved
src/indexer/segment_updater.rs Outdated Show resolved Hide resolved
src/future_result.rs Show resolved Hide resolved
src/indexer/prepared_commit.rs Show resolved Hide resolved
src/indexer/prepared_commit.rs Outdated Show resolved Hide resolved
fulmicoton and others added 2 commits March 18, 2022 16:11
Co-authored-by: PSeitz <PSeitz@users.noreply.github.com>
@fulmicoton fulmicoton merged commit 46d5de9 into main Mar 18, 2022
@fulmicoton fulmicoton deleted the remove-block-on branch March 18, 2022 07:54
PSeitz added a commit that referenced this pull request May 3, 2022
)

* Removes all usage of block_on, and use a oneshot channel instead.

Calling `block_on` panics in certain context.
For instance, it panics when it is called in a the context of another
call to block.

Using it in tantivy is unnecessary. We replace it by a thin wrapper
around a oneshot channel that supports both async/sync.

* Removing needless uses of async in the API.

Co-authored-by: PSeitz <PSeitz@users.noreply.github.com>
This was referenced Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants