Logs missing when waking a suspended machine

I’m running a PHP application, and I’ve noticed that when a suspended machine wakes in response to an HTTP request, any errors logged to /dev/stderr via error_log(), fwrite(), or syslog() don’t appear in Fly’s logging system or Grafana. In fact another error appears:

[info]ERROR stderr to vsock zero copy err: Socket not connected (os error 107)

It seems like the machine is able to serve requests before it fully reconnects to the logging system, causing logs from the first few seconds after waking to be lost.

I’m considering workarounds and wondering:

  1. Is there a way to determine how recently a machine was resumed from suspension? This could help delay logging until it’s fully connected.

  2. Is there an alternative logging endpoint I could send errors to instead of relying on /dev/stderr?

Has anyone else encountered this issue or found a good way to ensure logs aren’t lost when a machine wakes? I realize this could also be PHP-specific.

Thanks!

Yes this is an issue w/ the suspend features. There’s also another problem where if you have 2 suspended apps that communicate with each other, eg a web server + proxy. When both wake from suspension, the 1st request is fast but the subsequent requests take up to 10 seconds (probably due to time desync)

I suspect that this delay may be caused by Issue with Proxy Routing and Health Checks After Machine Resume.

1 Like