mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Fix crash in arangodb filer when attempting to access a deleted bucket (#3587)
* Update helpers.go * Update arangodb_store_bucket.go
This commit is contained in:
parent
3621987727
commit
bf844d8e46
|
@ -34,6 +34,9 @@ func (store *ArangodbStore) OnBucketDeletion(bucket string) {
|
||||||
glog.Errorf("bucket delete %s: %v", bucket, err)
|
glog.Errorf("bucket delete %s: %v", bucket, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
store.mu.Lock()
|
||||||
|
delete(store.buckets, bucket)
|
||||||
|
store.mu.Unlock()
|
||||||
}
|
}
|
||||||
func (store *ArangodbStore) CanDropWholeBucket() bool {
|
func (store *ArangodbStore) CanDropWholeBucket() bool {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -86,7 +86,7 @@ func (store *ArangodbStore) ensureBucket(ctx context.Context, bucket string) (bc
|
||||||
store.mu.RLock()
|
store.mu.RLock()
|
||||||
bc, ok = store.buckets[bucket]
|
bc, ok = store.buckets[bucket]
|
||||||
store.mu.RUnlock()
|
store.mu.RUnlock()
|
||||||
if ok {
|
if ok && bc != nil {
|
||||||
return bc, nil
|
return bc, nil
|
||||||
}
|
}
|
||||||
store.mu.Lock()
|
store.mu.Lock()
|
||||||
|
|
Loading…
Reference in a new issue