Skip to content

[BTS-2171] Wait immediately after sending network requests with skipScheduler #21869

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

Merged
merged 3 commits into from
Aug 13, 2025

Conversation

goedderz
Copy link
Member

@goedderz goedderz commented Jul 17, 2025

Scope & Purpose

When waiting synchronously on network requests, the network request should generally get the option skipScheduler=true. However, care must be taken so the network thread does not have to execute arbitrary code when resolving the response promise.

This is not done properly in many places. For example, many methods in transaction::Methods look similar to

... Methods::insert(...) {
  return insertInternal(..., MethodsApi::Synchronous)
      .waitAndGet();
}

. Without additional changes however, this means all code that happens after co_awaiting the network request might (and will usually) be executed on the network thread.

The most straightforward solutions seems to be to call .wait() on the response-future immediately after sending the request, in the case where the function was called synchronously.

  • 💩 Bugfix

Checklist

  • 📖 CHANGELOG entry made
  • Backports
    • Backport for 3.12.0: (Please link PR)
    • Backport for 3.11: (Please link PR)
    • Backport for 3.10: (Please link PR)

Related Information

@goedderz goedderz added this to the devel milestone Jul 17, 2025
@goedderz goedderz self-assigned this Jul 17, 2025
@goedderz goedderz added the 9 WIP label Jul 17, 2025
@cla-bot cla-bot bot added the cla-signed label Jul 17, 2025
@goedderz goedderz changed the title Wait immediately after sending network requests with skipScheduler [BTS-2171] Wait immediately after sending network requests with skipScheduler Aug 6, 2025
@goedderz goedderz marked this pull request as ready for review August 6, 2025 12:19
@goedderz goedderz removed the 9 WIP label Aug 6, 2025
@goedderz goedderz merged commit 7c28b23 into devel Aug 13, 2025
1 of 2 checks passed
@goedderz goedderz deleted the bug-fix/bts-2171-wait-after-skipScheduler branch August 13, 2025 10:25
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