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
storage.Writer took an assumption that CloseWithError() could be called
more than once, and was thread-safe with respect to concurrent Write(),
Flush(), and Close() calls. This was not honored in the refactor in
#12422.
Modify Writer so that it is thread-safe to provide these behaviors, and
support repeated Close() and CloseWithError() calls.
To address this, we start the sender goroutine earlier, and gather the
first buffer in that goroutine. It's possible that some workloads which
gather less than one buffer worth of data with a sequence of small
writes will observe a performance hit here, since those writes used to
be direct copies but will now be a channel ping-pong. If that's an
issue, it could be improved by wrapping the buffer in a mutex and doing
more explicit concurrency control.
0 commit comments