-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os: output buffer seems to be blocked by first come, first serve #35253
Comments
Your program does not wait for all the goroutines to complete. If I add a |
nice! Seems to solve the issue for now for the sample program. Thanks! My issue here was apparently, that the program was clased before the goroutines finished. However this will not solve the issue with my normal program - as the programm runs infinitely, but my logs dissappear too. Is there a smoother way to access the standard output than just using btw: For anyone who is interested in the sync solution:
|
Where are your logs going? If they are going to a file that is not opened in append mode, then I think that multiple concurrent writes can overlap. This should not happen if they are going to the ordinary standard output/standard error, nor if they are going to a file opened in append mode. |
achtually they are indeed going to either But I am seeing the issues while performing jmeter load-tests even without the docker-environment (round about 700 requests per second) - so only |
What version of Go are you using (
go version
)?1.13.3
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?What did you do?
I have a very heavy load application, where I use the standard program output as logging output. This logging output is then redirected by docker towards a logserver. So far so nice.
This works perfectly, but sometimes I am missing some log lines - while the code after the print has been executed. It looks like there is an issue when two concurrent threads access the output of the application - is this intended or cannot be resolved? Maybe I am using the wrong way to output my data? I could not find anything related to that.
I've written a short example code, which seems to reproduce the problem - the same issue occurs when using
fmt.println()
What did you expect to see?
The same result as I would get with the println(i) commented in and the go-call commented out, which in my case always produces all outputs.
What did you see instead?
each time other values (which are part of the output) - I guess the first comming output blocks the other outputs.
The text was updated successfully, but these errors were encountered: