Conversation
There was a problem hiding this comment.
Performed full review of 330685e...cd0123c
Tip
⚡ Quick Actions
This review was generated by Mesa.
Actions:
Slash Commands:
/review- Request a full code review/review latest- Review only changes since the last review/describe- Generate PR description. This will update the PR body or issue comment depending on your configuration/help- Get help with Mesa commands and configuration options
9 files reviewed | 3 comments | Review on Mesa | Edit Reviewer Settings
| -e LOG_CDP_MESSAGES=true \ | ||
| -p 9222:9222/tls | ||
| -p 444:10001/tls | ||
| --vcpus 2 |
| clientConn.SetReadDeadline(time.Time{}) // No timeout--hold on to connections for dear life | ||
| clientConn.SetWriteDeadline(time.Time{}) // No timeout--hold on to connections for dear life | ||
| clientConn.SetReadLimit(100 * 1024 * 1024) // 100 MB. Effectively no maximum size of message from client | ||
| clientConn.EnableWriteCompression(true) |
There was a problem hiding this comment.
|
|
||
| // Extract fields using regex from raw message | ||
| rawMsg := string(msg) | ||
|
|
There was a problem hiding this comment.
Sayan-
left a comment
There was a problem hiding this comment.
Overall lgtm! A few questions I had prior to merging:
- How'd we decide the buffer sizes? What's the behavior when those buffers get full?
- Any concerns with additional resource usage enabling compression? Any other changes we need to make to enable the compression? I'd expect it to just work with chromium but unclear from our intermediate hops. From the docs I see:
This function is a noop if compression was not negotiated with the peer.
|
Sayan-
left a comment
There was a problem hiding this comment.
== to both thanks for confirming! I haven't read the gorilla implementation deeply enough to confirm whether it would drop packets / eventually terminate the connection when the buffer gets filled. Cross checking their current code and we're a 16x bump from the default, which I think we can continue to bump without too many worries (https://github.com/gorilla/websocket/blob/main/conn.go#L36-L37)
7cdd3f8 to
9aa81ef
Compare
todo:
TL;DR
Fixes websocket disconnections by removing the aggressive heartbeat ping that was causing timeouts during heavy initial browser load.
Why we made these changes
During initial startup, the browser's Chrome DevTools Protocol (CDP) connection can be saturated with large amounts of data (e.g., accessibility tree, full document), which can be many megabytes. The existing heartbeat ping was timing out during this heavy load, causing us to prematurely close valid connections. These changes make the connection more lenient and robust, especially during startup.
What changed?
server/lib/devtoolsproxy/proxy.goto prevent timeouts. Adjusted websocket dialer settings to be more lenient with larger buffers, compression, and no deadlines.LOG_CDP_MESSAGESenvironment variable to log a condensed form of each CDP message for easier debugging.shared/uk-check-stats.shscript to compute and display a real CPU percentage and network throughput in KB/s.run-unikernel.shscripts for bothchromium-headful(4 vCPUs) andchromium-headless(1 vCPU) to align resource usage with production environments.Description generated by Mesa. Update settings