Closed Bug 1721148 Opened 3 years ago Closed 3 years ago

Errors thrown during WebSocket upgrade could hang clients when reading HTTP response

Categories

(Remote Protocol :: Agent, defect, P2)

defect
Points:
2

Tracking

(firefox92 fixed)

RESOLVED FIXED
92 Branch
Tracking Status
firefox92 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

Details

(Whiteboard: [bidi-m1-mvp])

Attachments

(1 file)

Using a non websocket compatible HTTP client like curl, and trying to connect to an existing WebDriver session will hang the request. Internally you can see errors like:

[JavaScript Error: "Error: The handshake request has incorrect Upgrade header: undefined" {file: "chrome://remote/content/server/WebSocketHandshake.jsm" line: 84}]

But sadly those aren't returned to the client. As such the request hangs until a timeout.

Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Summary: Errors thrown during WebSocket upgrade hangs HTTP request → Errors thrown during WebSocket upgrade could hang clients when reading HTTP response
Priority: P3 → P2

Using triage whiteboard entry to discuss inclusion for M1.

Whiteboard: [webdriver:triage]

When a WebSocket upgrade fails we currently do not
send any details of the error. As such it makes
it hard to figure out the real underlying issue.

Further some clients like curl are hanging and do
not immediately exit when the response has been
received. Specifying the Content-Length header
within the response fixes it.

Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eec37405fe16
[remote] Report WebSocket handshake failures to the client. r=webdriver-reviewers,jgraham
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch
Points: --- → 2
Whiteboard: [webdriver:triage] → [bidi-m1-mvp]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: