You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use your s3gof3r library where I work for downloading files from S3, and we recently noticed what we thought was a goroutine leak. Our monitoring showed a increase in the amount of memory being used that correlated exactly with a growing count of goroutines. We added a goroutine to print out the stack traces of all goroutines periodically, and we saw a lot of stack traces that looked like this:
I'm not 100% sure how the code gets into this state. My guess is that the getter.Read() function is returning and I'm calling getter.Close() before initChunks() is done. The getter.Close() closes the g.sp.quit channel, and that causes the goroutine in bufferPool() to exit before initChunks() is done. I think that if you closed the bp.get channel at the end of the goroutine in bufferPool(), and checked for this condition in retryGetChunk(), it allow the worker goroutines to exit and not wait forever in retryGetChunk().
The text was updated successfully, but these errors were encountered:
We use your s3gof3r library where I work for downloading files from S3, and we recently noticed what we thought was a goroutine leak. Our monitoring showed a increase in the amount of memory being used that correlated exactly with a growing count of goroutines. We added a goroutine to print out the stack traces of all goroutines periodically, and we saw a lot of stack traces that looked like this:
I'm not 100% sure how the code gets into this state. My guess is that the getter.Read() function is returning and I'm calling getter.Close() before initChunks() is done. The getter.Close() closes the g.sp.quit channel, and that causes the goroutine in bufferPool() to exit before initChunks() is done. I think that if you closed the bp.get channel at the end of the goroutine in bufferPool(), and checked for this condition in retryGetChunk(), it allow the worker goroutines to exit and not wait forever in retryGetChunk().
The text was updated successfully, but these errors were encountered: