Skip to content

fix: harden ASGI bridge response scheduling under load - #68

Merged
ZhuchkaTriplesix merged 2 commits into
devfrom
issue-17-asgi-bridge-followup
Apr 27, 2026
Merged

ZhuchkaTriplesix merged 2 commits into
devfrom
issue-17-asgi-bridge-followup

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

  • replace blocking run_coroutine_threadsafe(...).result() calls in ASGI protocol response helpers with a thread-safe outgoing queue
  • drain queued ASGI http.response.* messages on the main event loop while handle_rsgi runs in an executor thread
  • update ASGI bridge docs to reflect queue-based scheduling and deadlock model

Test plan

  • make test (maintainer run)
  • verify tests/test_asgi_stress.py::test_asgi_50_concurrent_gets
  • optional uvicorn/granian ASGI smoke under concurrent requests

Closes #17

Replace run_coroutine_threadsafe(...).result() with a thread-safe outgoing queue drained on the main ASGI loop to reduce deadlock risk under concurrent load.
Document the queue-based response bridge and align the deadlock explanation with the new non-blocking send scheduling model.
@ZhuchkaTriplesix ZhuchkaTriplesix added this to the v0.2.0 milestone Apr 27, 2026
@ZhuchkaTriplesix ZhuchkaTriplesix self-assigned this Apr 27, 2026

@ZhuchkaTriplesix ZhuchkaTriplesix left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

123

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit d18e8b0 into dev Apr 27, 2026
16 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue-17-asgi-bridge-followup branch April 27, 2026 09:17
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.

fix: review ASGI protocol bridge (run_coroutine_threadsafe) under load

1 participant