Open Bug 1801383 Opened 2 years ago Updated 1 year ago

TLS failure on certless websocket test races

Categories

(Core :: Networking: WebSockets, defect, P3)

defect

Tracking

()

People

(Reporter: edgul, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

As a part of websocket over h2 refactor a test was added to verify consistent TLS failure when we directly attempt websocket connection without adding the required cert.

The written test (netwerk/test/unit/test_websocket_fails.js) works, but contains two asserts as the main test to cover the fact that a race condition occurs that yields different status results.

Since the race itself pre-existed the patch and newly created task, we deemed its resolution out of scope for the above bug.

The problem seems to arise from the fact that we receive delayed, correct TLS failure nsSocketOutputStream::OnSocketReady [this=7fda5800c6f8 cond=805a1ff3] well after nsSocketOutputStream::CloseWithStatus [this=7fda5800c6f8 reason=804b0014] (NS_ERROR_NET_RESET) is received and updates the listening test.

This bug aims to understand why the above occurs and repair it so the code reliably returns the desired TLS failure code. This will allow the removal of the two asserts in the associated test.

Severity: -- → S3
Priority: -- → P3
Whiteboard: [necko-triaged]

Ni-ing myself to update bug with assert location once the test code lands.

Flags: needinfo?(edgul)

Noting an example location of where the race occurs, though there are a few locations this pattern exists.
https://searchfox.org/mozilla-central/rev/8e1b221afcdae76284b1439c547b032d1f84d236/netwerk/test/unit/test_websocket_fails.js#48-57

Flags: needinfo?(edgul)
You need to log in before you can comment on or make changes to this bug.