-
-
Notifications
You must be signed in to change notification settings - Fork 955
fix(WebSocket): handle OSError
upon send()
+ fix max_receive_queue == 0
#2324
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
bfebf03
feat(WebSocket): handle `OSError` upon `send()`
vytas7 11f5e41
fix(WebSocket): fix the `max_receive_queue == 0` case (WiP)
vytas7 b4a6a4d
chore: do not build rapidjson on PyPy
vytas7 14e29ae
test(WebSocket): add tests for the max_receive_queue==0 case
vytas7 5b6d650
docs(ws): revise "Lost Connections" in the light of ASGI WS spec 2.4
vytas7 637676a
docs: market this as bugfix instead
vytas7 b5bf8fc
test(WS): add a zero receive queue test with real servers
vytas7 18dc1aa
docs(WS): polish newsfragment
vytas7 432d5d4
docs(WS): tone down inline comment
vytas7 db2c3c4
Merge branch 'master' into 2292-asgi-ws-2.4-send
vytas7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ pip-log.txt | |
.ecosystem | ||
.tox | ||
.pytest_cache | ||
downloaded_files/ | ||
geckodriver.log | ||
htmlcov | ||
nosetests.xml | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Falcon will now raise an instance of | ||
:class:`~falcon.errors.WebSocketDisconnected` from the :class:`OSError` that | ||
the ASGI server signals in the case of a disconnected client (as per | ||
the `ASGI HTTP & WebSocket protocol | ||
<https://asgi.readthedocs.io/en/latest/specs/www.html#id2>`__ version ``2.4``). | ||
It is worth noting though that Falcon's | ||
:ref:`built-in receive buffer <ws_lost_connection>` normally detects the | ||
``websocket.disconnect`` event itself prior the potentially failing attempt to | ||
``send()``. | ||
|
||
Disabling this built-in receive buffer (by setting | ||
:attr:`~falcon.asgi.WebSocketOptions.max_receive_queue` to ``0``) was also | ||
found to interfere with receiving ASGI WebSocket messages in an unexpected | ||
way. The issue has been fixed so that setting this option to ``0`` now properly | ||
bypasses the buffer altogether, and extensive test coverage has been added for | ||
validating this scenario. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.