Skip to content

v16.5.0

Compare
Choose a tag to compare
@flowzone-app flowzone-app released this 30 Jul 18:49
· 124 commits to master since this release
0124952

Logs processing improvements

  • The supervisor no longer uses the database to store the last log sent timestamp. Using the database for this is not justified since journal logs are lost between reboots in most cases and even when they are not, the logs throughput is limited by the network speed and the storage provided by the backend, so overall the number of lost logs will be minimal.
  • Removes use of the JSONStream module for log processing, switching to the native JSON.parse.
  • It modifies the logs processing pipe to use an async Node pipeline, this will avoid memory leaks due to an error on the pipe. Because it uses async processing, it prevents the stream handling from overwhelming the event loop and ensures control is yielded back to the event loop while messages are being sent.
  • This PR also modifies the balena log backend (what uploads logs to the API), to use async functions, also yielding control back to the event loop between messages and creating backpressure on the log stream.

Overall the changes above should result in less memory and less CPU being used when processing logs, ensuring proper operation of the supervisor even under high load scenarios

List of commits

8bc0875 (Use promises for setup/writing for logging backend, 2024-07-22)
f3fcb0d (Improve the LogBackend interface, 2024-07-22)
5af9484 (Use stream pipeline instead of pipe, 2024-07-10)
dbacca9 (Do not use DB to store container logs info, 2024-07-10)