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

Fix bug where block_on was called from an async context #7425

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

MarkusPettersson98
Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 commented Jan 7, 2025

This PR fixes a regression introduced in the 2025.1 release. The fix is simple enough, simply call log_tunnel_data_usage from a thread where blocking is acceptable.


This change is Reviewable

@MarkusPettersson98 MarkusPettersson98 marked this pull request as ready for review January 7, 2025 14:11
Copy link
Contributor

@Serock3 Serock3 left a comment

Choose a reason for hiding this comment

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

Great work finding and fixing this! log_tunnel_data_usage is called on line 493 too, for the android version of the function. You should probably make the same change there also

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor

@Serock3 Serock3 left a comment

Choose a reason for hiding this comment

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

NVM, I didn't realize that the bug only affects Linux

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor Author

@MarkusPettersson98 MarkusPettersson98 left a comment

Choose a reason for hiding this comment

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

You are right though, we should assume that the log_tunnel_data_usage performs blocking IO imho. Atleast it is not async anymore 😊

Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @Serock3)

Copy link
Contributor

@Pururun Pururun left a comment

Choose a reason for hiding this comment

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

This PR literally changed my life.

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor

@Serock3 Serock3 left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@MarkusPettersson98 MarkusPettersson98 force-pushed the patch-block-on-in-tokio-task branch from a2c5b58 to beee5dc Compare January 7, 2025 16:16
@MarkusPettersson98 MarkusPettersson98 changed the base branch from prepare-2024.9 to prepare-2025.2 January 7, 2025 16:18
@MarkusPettersson98 MarkusPettersson98 merged commit d56bff9 into prepare-2025.2 Jan 7, 2025
52 of 53 checks passed
@MarkusPettersson98 MarkusPettersson98 deleted the patch-block-on-in-tokio-task branch January 7, 2025 16:19
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