Igalia / meta-webkit

Yocto / OpenEmbedded layer for WebKit based engines and browsers
MIT License
125 stars 67 forks source link

Network freeze observed through websocket client running on page #429

Closed clorichel closed 1 year ago

clorichel commented 1 year ago

Describe the bug I'm having frequent "network freezes" observed with a websocket client running on the page browsed by WPE Webkit.

Every few minutes, the websocket client running on that webpage (rendered with WPE Webkit) will not answer the ping from the websocket server. Then it will take that webpage anywhere from 30 to 90 seconds to actually reconnect to the server.

Not sure "freeze" is the appropriate word, but it looks like the webpage stopped, or at least blacked out network communications during those periods of time, then it suddenly "reappears", and then business as usual, everything is back to normal, until it eventually freezes again 🙃

Mentioning "network" because during those freezes, there are visual animations going on the webpage with no freeze at all. That webpage also outputs some music, which is continuously played during those events. That leads me to think the freeze is somehow limited to the network, but obviously I might be wrong about that assumption, it's just what I'm observing (graphics and musics are going, network is down).

To Reproduce

  1. using the latest stable version (2.38.0) of wpe-webkit-mir-kiosk snap
  2. over the latest (90-mir2.10.0) ubuntu-frame
  3. on the latest (22) Ubuntu Core
  4. running a Socket.IO server with default 5s pingTimeout and 25s pingInterval
  5. running a Socket.IO client on the webpage rendered via WPE Webkit
  6. running the same Socket.IO client on the same webpage but on another computer/browser

Expected behavior The websocket / network connection should just be stable all the time.

Screenshots Implementing a latency check every 5 seconds, through a socket.emit run on the webpage, and a server callback to log the actual latency server-side:

// on the webpage
setInterval(() => {
  const start = Date.now();

  socket.emit('latency-test', () => {
    const duration = Date.now() - start;
    socket.emit('latency-test-result', duration);
  })
}, 5000)
// on the server
socket.on('latency-test', (callback) => {
  logger.debug(`Websocket client id#${socket.id} latency-test`);
  callback();
});
socket.on('latency-test-result', (duration) => {
  logger.info(`Websocket client id#${socket.id} latency-test-result is ${duration}ms`);
});

We can see:

info: Websocket client id#btJn7HWoV2iHofhRAAAA latency-test-result is 2ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 7ms
info: Websocket client id#btJn7HWoV2iHofhRAAAA latency-test-result is 2ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 112ms
info: Websocket client id#btJn7HWoV2iHofhRAAAA latency-test-result is 2ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 8ms
info: Websocket client id#btJn7HWoV2iHofhRAAAA latency-test-result is 2ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 71ms
info: Websocket client id#btJn7HWoV2iHofhRAAAA latency-test-result is 1ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 11ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 9ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 15ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 9ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 13ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 11ms
info: Websocket client id#btJn7HWoV2iHofhRAAAA disconnected with reason: ping timeout
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 6ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 13ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 9ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 8ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 161ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 10ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 25ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 11ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 9ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 8ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 8ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 9ms
info: Websocket client id#qlfogrmuaE8DPtjVAAAF connected
info: Websocket client id#qlfogrmuaE8DPtjVAAAF latency-test-result is 861ms
info: Websocket client id#qlfogrmuaE8DPtjVAAAF latency-test-result is 4ms
info: Websocket client id#-PF_fCkJEncteXVBAAAD latency-test-result is 11ms

Again, during this network freeze, both the animations and the music on page just keep going normally.

Environment (please complete the following information):

Additional context I'm at a loss when thinking about where to start digging in to solve this issue. Any pointers that could help me help myself? 🤗 🤓

Thank you ❤️

clorichel commented 1 year ago

Addendum to the Additional context: as this has been driving me crazy 😜 I've been closely monitoring the machine htop during the whole time, and I haven't seen anything funky going on before, when and after the WPE Webkit ran webpage stopped responding.

psaavedra commented 1 year ago

Hi @clorichel . This report shound like not directly related with Yocto meta-webkit itself but with an specific WPEWebKit build for ubuntu-core release. Could you clarify this information? If that is the case I' suggest to you to fill the ticket in https://bugs.webkit.org/enter_bug.cgi (https://webkit.org/reporting-bugs/)

woodreamz commented 1 year ago

@clorichel I am experiencing a similar issue, it's starting to make me crazy :D

By any chance, did you find any solution or anything which help you?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stale for 7 days with no activity.