Renovate: util/exec should stream logs

Created on 2 Jun 2020  Â·  6Comments  Â·  Source: renovatebot/renovate

If we time out an exec call today (e.g. after 15 minutes) and kill it then we lose all logs. Also, we run the risk of overloading our buffer. We should instead use another approach (spawn?) to stream the logs and save our copy locally.

priority-2-important refactor

All 6 comments

So basically we want to preserve stdout for printing with PR warnings, but additionally log it string by string?

I was wondering if the experience for everyone would also be better if we combine stdout & stderr too actually (e.g. 2>&1).

But the main reasons are:

  • We still get logs even if we have to kill the child process, and
  • No more worrying about child process running out of memory buffer

I managed to redirect outputs for Cocoapods run:
image

Sorry, I think I confused you. I still want it collected into a single “result”, just done using streaming and not exec.

https://stackoverflow.com/a/32872753/2506019 — is this approach correct? (Asynchronous part)
I'm trying to mimic our current rawExec function, returning same ExecResult at the end.

If convenient, I can also immediately log spawned command output (like in the screenshot above).

Logging immediately would result in a lot of additional logging messages, which is not ideal. So I prefer to buffer it and only return it at the end for logging.

Although we don’t really execute any other code while we’re waiting for the child process to finish, having an asynchronous implementation is most forwards compatible

Was this page helpful?
0 / 5 - 0 ratings