Skip to content

Fix non-blocking query/mutation execution#35

Closed
jwaldrip wants to merge 6 commits into
absinthe-graphql:mainfrom
gigsmart:fix-non-blocking-queries
Closed

Fix non-blocking query/mutation execution#35
jwaldrip wants to merge 6 commits into
absinthe-graphql:mainfrom
gigsmart:fix-non-blocking-queries

Conversation

@jwaldrip

@jwaldrip jwaldrip commented Sep 5, 2025

Copy link
Copy Markdown

Summary

  • Fixed blocking behavior in query/mutation execution to allow concurrent operations per connection
  • Simplified async handling by using Task.async instead of complex Task.Supervisor approach
  • Added conditional support for OpentelemetryProcessPropagator.Task for proper distributed tracing

Problem

Previously, queries and mutations were blocking, allowing only one query in progress per connection. This was incorrect as each query should be able to be fired and asynchronously listen for its response, following a similar flow to subscriptions.

Solution

  • Simplified the handle_query_or_mutation function to use Task.async for non-blocking execution
  • Results are delivered asynchronously via PubSub broadcasts
  • Added automatic detection and use of OpentelemetryProcessPropagator.Task when available for proper tracing context propagation
  • Removed unnecessary QuerySupervisor module that added complexity without benefit

Test Results

All tests pass, including the specific non_blocking_query_test.exs that verifies:

  • Multiple queries can execute concurrently
  • Fast queries complete before slow queries
  • All concurrent queries complete correctly

This brings query/mutation handling in line with how subscriptions work and matches what frontend transport layers expect.

🤖 Generated with Claude Code

jwaldrip and others added 6 commits February 19, 2025 09:51
Simplified async query/mutation handling to properly support concurrent operations:
- Replaced complex Task.Supervisor approach with simple Task.async
- Added conditional support for OpentelemetryProcessPropagator.Task for proper tracing
- Removed unnecessary QuerySupervisor module
- Queries/mutations now execute asynchronously like subscriptions

This allows multiple queries to run concurrently per connection, with fast
queries completing before slow ones as expected by frontend transport layers.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jwaldrip

jwaldrip commented Feb 6, 2026

Copy link
Copy Markdown
Author

Hey — just checking in on this fix for non-blocking query/mutation execution. Any thoughts or concerns?

@bryanjos bryanjos left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks good! Depending on the usage, we may have to limit the number of tasks running at a time, but I think this is a good starting point.

@jwaldrip jwaldrip closed this Jul 14, 2026
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.

2 participants