aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/arangodb
diff options
context:
space:
mode:
authorgfx <86091021+gfxlabs@users.noreply.github.com>2022-09-04 22:32:10 -0500
committerGitHub <noreply@github.com>2022-09-04 20:32:10 -0700
commitbf844d8e4623932cbe48d1b461894ade8a65b610 (patch)
tree58590fdae57954cb41bdad6c923fa6d450b8829b /weed/filer/arangodb
parent36219877274e70cfe5df6a027b2ddf5ed4b65cc8 (diff)
downloadseaweedfs-bf844d8e4623932cbe48d1b461894ade8a65b610.tar.xz
seaweedfs-bf844d8e4623932cbe48d1b461894ade8a65b610.zip
Fix crash in arangodb filer when attempting to access a deleted bucket (#3587)
* Update helpers.go * Update arangodb_store_bucket.go
Diffstat (limited to 'weed/filer/arangodb')
-rw-r--r--weed/filer/arangodb/arangodb_store_bucket.go3
-rw-r--r--weed/filer/arangodb/helpers.go2
2 files changed, 4 insertions, 1 deletions
diff --git a/weed/filer/arangodb/arangodb_store_bucket.go b/weed/filer/arangodb/arangodb_store_bucket.go
index b35a5c9b3..44aeeadea 100644
--- a/weed/filer/arangodb/arangodb_store_bucket.go
+++ b/weed/filer/arangodb/arangodb_store_bucket.go
@@ -34,6 +34,9 @@ func (store *ArangodbStore) OnBucketDeletion(bucket string) {
glog.Errorf("bucket delete %s: %v", bucket, err)
return
}
+ store.mu.Lock()
+ delete(store.buckets, bucket)
+ store.mu.Unlock()
}
func (store *ArangodbStore) CanDropWholeBucket() bool {
return true
diff --git a/weed/filer/arangodb/helpers.go b/weed/filer/arangodb/helpers.go
index 35796a8f8..3f36acb0a 100644
--- a/weed/filer/arangodb/helpers.go
+++ b/weed/filer/arangodb/helpers.go
@@ -86,7 +86,7 @@ func (store *ArangodbStore) ensureBucket(ctx context.Context, bucket string) (bc
store.mu.RLock()
bc, ok = store.buckets[bucket]
store.mu.RUnlock()
- if ok {
+ if ok && bc != nil {
return bc, nil
}
store.mu.Lock()