Closed LucasRoesler closed 10 months ago
Whilst I think this patch should be merged, it does also add a lot of complexity and maintenance overhead.
Would making the total buffer size configurable per function (retaining the default) also fix the issue?
Whilst I think this patch should be merged, it does also add a lot of complexity and maintenance overhead.
Would making the total buffer size configurable per function (retaining the default) also fix the issue?
Most of the complexity in this change comes from the fact that of-watchdog uses log
instead of just printing to stdout, if we are willing to make a breaking change, we can simplify this a lot.
I don't think just configuring the buffer size is going to be a great dev experience because what would otherwise be a successful function request could instead completely crash an instance without much warning just because of logging. Making it configurable means it could be resolved for each case, but we will continue to see questions about it (even if we document it)
Description
Use the bufio ReadLine method so that we can check if the the log line has been broken into several parts due to the internal buffering. This implementation has been adapted from https://github.com/hashicorp/go-plugin/pull/98
The implementation also preserves the timestamp prefix and is fully backwards compatible.
Motivation and Context
Resolves #100
How Has This Been Tested?
A new unit test has been added
Types of changes
Checklist:
git commit -s