websockets - deflate stream and pywebsockets-07 unclean closes

RESOLVED FIXED in mozilla7

Status

()

Core
Networking: WebSockets
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: mcmanus, Assigned: mcmanus)

Tracking

unspecified
mozilla7
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [inbound])

Attachments

(3 attachments)

(Assignee)

Description

6 years ago
pywebsockets version 470 can generate TCP RSTs when using the deflate-stream extension, or in certain other error cases. These manifest as unclean close errors in some of the websocket tests (often test-8 of test_Websocket.html, but they can be anywhere), depending on the test case this pops up a random orange. Due to this issue with the tests the deflate-stream extension was preffed off when checked in (see bug 658546).

The issue has been resolved entirely in things NPOTB.

I am going to attach 3 patches here:

* update our test code to rev 489 of pywebsockets. This fixes a different compression bug in the server and to avoid forking the code, it is what I based the next patch on (NPOTB)

* a patch to drain the input buffers in pywebsockets before doing a socket level close, to remove the cause of the RST. I have sent this to the pywebsockets author. (NPOTB)

* a patch to re-enable the deflate-stream extension which should now run without orange.

once this is landed I'll ask for aurora approval as no code in firefox has changed.
(Assignee)

Comment 1

6 years ago
Created attachment 538246 [details] [diff] [review]
update pywebsockets to 489 v1
Assignee: nobody → mcmanus
Status: NEW → ASSIGNED
Attachment #538246 - Flags: review?(cbiesinger)
(Assignee)

Comment 2

6 years ago
Created attachment 538247 [details] [diff] [review]
make pywebsockets avoid RST v1
Attachment #538247 - Flags: review?(cbiesinger)
(Assignee)

Comment 3

6 years ago
Created attachment 538249 [details] [diff] [review]
turn deflate-stream on v1
Attachment #538249 - Flags: review?(cbiesinger)
Attachment #538246 - Flags: review?(cbiesinger) → review+
Comment on attachment 538247 [details] [diff] [review]
make pywebsockets avoid RST v1

+              data = self._connection.read(1)

why do this byte-by-byte? why not read larger chunks?
Attachment #538247 - Flags: review?(cbiesinger) → review+
Attachment #538249 - Flags: review?(cbiesinger) → review+
(Assignee)

Comment 5

6 years ago
(In reply to comment #4)
> Comment on attachment 538247 [details] [diff] [review] [review]
> make pywebsockets avoid RST v1
> 
> +              data = self._connection.read(1)
> 
> why do this byte-by-byte? why not read larger chunks?

mostly just because that's what pywebsockets already does for data of undetermined length.. and realistically I know it is just 3 to 5 bytes.
(Assignee)

Updated

6 years ago
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/776b0b91568e
http://hg.mozilla.org/mozilla-central/rev/30653af91633
http://hg.mozilla.org/mozilla-central/rev/2146642133c4
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Depends on: 687295
You need to log in before you can comment on or make changes to this bug.