GoogleCloudPlatform / guest-agent

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Process output longer than 64k swallows all remaining logging

zachmu opened this issue · comments

This is basically the same feedback as #149, which I don't have permission to reopen.

Our customer just hit this problem. A process logging a line longer than 64k (the default buffer size for bufio.NewScanner) will swallow any output up to that point and after. Our process is a database that under some logging configurations logs query strings, which can be arbitrarily long. This makes it difficult to debug crashes in particular since any panic output or similar will not be logged.

Asking users to change the logging behavior of binaries they don't own is not a feasible workaround. Making the buffer size configurable via parameters / environment variables would be. Better yet: have fallback behavior when the scanner buffer overflows, rather than refusing to log output.