]> Cypherpunks repositories - gostls13.git/commit
log/slog: fix issue with concurrent writes
authorWill Roden <will@roden.cc>
Wed, 12 Jul 2023 22:23:09 +0000 (17:23 -0500)
committerJonathan Amsterdam <jba@google.com>
Fri, 14 Jul 2023 17:30:35 +0000 (17:30 +0000)
commit847d40d699832a1e054bc08c498548eff6a73ab6
tree860645cdd110a915e3a63c881b3edafa68ce30f8
parentc30faf9c54a764b78db003de262517f0c7359ed2
log/slog: fix issue with concurrent writes

This causes instances commonHandler created by withAttrs or withGroup to
share a mutex with their parent preventing concurrent writes to their
shared writer.

Fixes #61321

Change-Id: Ieec225e88ad51c84b41bad6c409fac48c90320b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/509196
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
src/log/slog/handler.go
src/log/slog/handler_test.go
src/log/slog/json_handler.go
src/log/slog/text_handler.go