[ui] HTTP RPC Engine attempts reconnection until disposal#168
[ui] HTTP RPC Engine attempts reconnection until disposal#168colin-grant-work merged 2 commits intosokatoafrom
Conversation
cdamus
left a comment
There was a problem hiding this comment.
Looks great! My tests with a script that forcibly closed the socket file descriptor in the Trace Processor Shell seems to show that the reconnection works.
I have a couple of nits remarked in-line. Maybe something to consider before merge or possibly for a follow-up ticket.
Another thing I wonder about is that while we're disconnected the queue of requests from Perfetto UI to the trace processor can pile up. Does it need to be limited to some maximum and, if exceeded, we give up retrying the disconnect and call super.fail() as we did previously to force the UI to error out? I'm not sure whether it's realistic to expect this queue actually can grow too large. Maybe this is another matter to table in a follow-up.
cdamus
left a comment
There was a problem hiding this comment.
Great! Tested with the Sokatoa-side PR.
| rpcSendRequestBytes(data: Uint8Array): void { | ||
| if (this.disposed) return; | ||
| this.websocket ??= this.initWebSocket(); | ||
| const websocket = this.getOrCreateWebSocket(); |
There was a problem hiding this comment.
Much prefer this nomenclature. Thanks!
Welcome to Perfetto!
Make sure your PR has a bug/issue attached or has at least
a clear description of the problem you are trying to fix.
This PR modifies the behavior of the HTTP RPC Engine so that it continues to attempt to reconnect, at progressively longer intervals, until it is disposed of. It will not throw errors to the window object on error or on disconnection.
For more details please see
https://perfetto.dev/docs/contributing/getting-started