Open Bug 1497249 Opened 2 years ago Updated 1 year ago

[socket-proc] Connection stickiness handling for upgrade observers

Categories

(Core :: Networking: HTTP, enhancement, P2)

enhancement

Tracking

()

Tracking Status
firefox64 --- affected

People

(Reporter: mayhemer, Assigned: kershaw)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(3 files)

Priority and also implementation of this bug depends on how we are going to handle websocket upgrades.  This is related to listening sockets as well - how are we going to deal with it.
Priority: -- → P3
Whiteboard: [necko-triaged]

To complete websocket upgrade, it means that the ownership of socket transport should be transfered [1] to websocket channel.
I am not sure how to do this since parent process can't access the socket transport in socket process. Maybe we have to provide IPC version of nsISocketTransport, nsIAsyncInputStream and nsIAsyncOutputStream [2].

[1] https://searchfox.org/mozilla-central/rev/89414a1df52d06cfc35529afb9a5a8542a6e4270/netwerk/protocol/http/nsHttpConnectionMgr.cpp#2875-2885
[2] https://searchfox.org/mozilla-central/rev/89414a1df52d06cfc35529afb9a5a8542a6e4270/media/mtransport/ipc/WebrtcProxyChannel.cpp#289

Hi Michal,

Could you take a look at comment2? I think adding IPC interface for nsISocketTransport and nsIAsync(Input/Output)Stream might be too complicated. Could you provide your insight here?

Thanks.

Flags: needinfo?(michal.novotny)

(In reply to Kershaw Chang [:kershaw] from comment #3)

Hi Michal,

Could you take a look at comment2? I think adding IPC interface for nsISocketTransport and nsIAsync(Input/Output)Stream might be too complicated. Could you provide your insight here?

Thanks.

I'm not sure I understand the problem here because I'm not familiar with socket process changes. Websocket channel needs the socket to read/write data from/to it.

Flags: needinfo?(michal.novotny)

(In reply to Michal Novotny [:michal] from comment #4)

(In reply to Kershaw Chang [:kershaw] from comment #3)

Hi Michal,

Could you take a look at comment2? I think adding IPC interface for nsISocketTransport and nsIAsync(Input/Output)Stream might be too complicated. Could you provide your insight here?

Thanks.

I'm not sure I understand the problem here because I'm not familiar with socket process changes. Websocket channel needs the socket to read/write data from/to it.

Sorry that I didn't explain how socket process works first.

The current architecture is keeping http channel in parent process and others under http channel (e.g. http transaction and http connection) in socket process. The thing is that the socket transport that Websocket channel needs is only accessible in socket process.

A possible solution is to implement IPC interface for nsISocketTransport, nsIAsyncInputStream and nsIAsyncOutputStream, but it seems this is a bit too complicated.

(In reply to Kershaw Chang [:kershaw] from comment #5)

A possible solution is to implement IPC interface for nsISocketTransport, nsIAsyncInputStream and nsIAsyncOutputStream, but it seems this is a bit too complicated.

I guess the other possible solution is to separate socket manipulation from the WebSocketChannel and let it run in the socket process. I'm not sure what is less complicated. Also, the generic solution could be used by other code, not just websocket channel.

Should be done before landing back to central with pref off

Priority: P3 → P2

Simple patch for enable upgrade again. Only without socket process.

https://hg.mozilla.org/projects/larch/rev/1a8cf90422a3a378bda9123dec8d8b8eebfc8220
leave open intentionally since we only deal with non-socket-process case

Assignee: nobody → kershaw
You need to log in before you can comment on or make changes to this bug.