Repository navigation
reset bufReader to avoid extreme growth of buffers - #10347
Conversation
|
ping @LK4D4 |
2822697 to
bd9cc8b
Compare
|
I tested - this fixing problem. I'm not reviewed code though. |
|
@LK4D4 Thanks for trying it out! |
|
This PR fixes 3 issues and it needs to be reviewed so that I can make any necessary changes after review and feedback. ping @crosbymichael @dmcgowan @duglin @erikh @icecrime @jfrazelle @jlhawn @LK4D4 @tiborvass @vbatts |
There was a problem hiding this comment.
isn't there potential here to overstep bounds with the type conversions? Should these really be int instead?
There was a problem hiding this comment.
@erikh I've made this explicit to avoid problems on 32bit platforms. I'm not sure how this could cause a problem.
There was a problem hiding this comment.
I guess int automatically gets promoted, or something. Sorry to waste your time.
|
looks good, the branching logic for reset should be cleaned up for readability and reduce the if blocks as Josh suggested |
There was a problem hiding this comment.
I believe there is time.Since for such thing.
There was a problem hiding this comment.
@LK4D4 I'm using now later on in the code and I'm avoiding getting a timestamp twice using this.
bd9cc8b to
8943b77
Compare
8943b77 to
b66771c
Compare
|
I've updated the PR to remove the truncate. |
b66771c to
c733e69
Compare
|
@unclejack should this be moved to the 1.6 milestone? iiuc, there won't be a 1.5.1 release? Also wondering if something is holding up this PR (apart from time constraint), as it seems to be resolving quite some issues 👍 |
|
I've rebased this PR on master and I'm using a binary built from this branch as my Docker daemon. @thaJeztah It needs more testing and reviews at this point. This was the simplest change which could have been made to fix this problem without hurting performance after trying many other options. There's not much left to change regarding the design itself. |
|
@unclejack Thanks for the explanation. So, this is effectively a buffer reader that does some read ahead? |
|
👍 |
|
@stevvooe Yes, it does read ahead so that it doesn't block the other readers by avoiding a reader to take too long to read everything. We need to figure out what else needs to be done for this and get it merged. Many users are affected by the problem this PR fixes. |
Signed-off-by: Cristian Staretu <[email protected]>
Signed-off-by: Cristian Staretu <[email protected]>
c733e69 to
e5ea2b2
Compare
|
The PR has been rebased on master and comments have been added. |
|
This PR needs to be in 1.6.0. |
|
LGTM |
1 similar comment
|
LGTM |
reset bufReader to avoid extreme growth of buffers
This PR is an attempt to help solve problems like #9139 and #8502.
This PR changes bufReader to try to avoid the growth of bytes.Buffer to extreme sizes (hundreds of megabytes or even gigabytes). This makes long running containers which need to log to the console more reliable over time.
Please note that this PR only fixes this problem for now. Proper logging support is still needed.
Fixes #9139
Fixes #8539
Fixes #8502