Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(storage): make Writer.CloseWithError block until writer exits
Writer.Close blocks on w.donec to return only after the spawned writer goroutine has exited. Previously CloseWithError did not block on this channel however, meaning it could return while the writer goroutine was still running, which could then lead to a caller e.g. closing the underlying Client, leading to a crash in the still-running goroutine. This adds the same block on the channel to CloseWithError to ensure that however a caller closes a Writer, it is fully closed when the close method returns and that caller can safely Close the client.
- Loading branch information