Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

Revert "avoid data race on grace.hooks (#3572)"

chrislud1bb23645e7a
diff --git a/weed/util/grace/signal_handling.go b/weed/util/grace/signal_handling.go
index 24d2b184fa..fc7afcad9d 100644
--- a/weed/util/grace/signal_handling.go
+++ b/weed/util/grace/signal_handling.go
@@ -12,7 +12,7 @@ import (
var signalChan chan os.Signal
var hooks = make([]func(), 0)
-var hookLock sync.RWMutex
+var hookLock sync.Mutex
func init() {
signalChan = make(chan os.Signal, 1)
@@ -27,9 +27,7 @@ func init() {
// syscall.SIGQUIT,
)
go func() {
- hookLock.RLock()
- defer hookLock.RUnlock()
- for range signalChan {
+ for _ = range signalChan {
for _, hook := range hooks {
hook()
}