Fix early init. problem for notifications (Fixes #2972) (#2977)

This commit is contained in:
Aditya Manthramurthy
2016-10-17 16:38:29 -07:00
committed by Harshavardhana
parent f8e13fb00e
commit 0ff359ca0e
2 changed files with 17 additions and 10 deletions
+11
View File
@@ -45,6 +45,13 @@ func newObjectLayer(storageDisks []StorageAPI) (ObjectLayer, error) {
return nil, err
}
// The following actions are performed here, so that any
// requests coming in early in the bootup sequence don't fail
// unexpectedly - e.g. if initEventNotifier was initialized
// after this function completes, an event could be generated
// before the notification system is ready, causing event
// drops or crashes.
// Migrate bucket policy from configDir to .minio.sys/buckets/
err = migrateBucketPolicyConfig(objAPI)
if err != nil {
@@ -62,6 +69,10 @@ func newObjectLayer(storageDisks []StorageAPI) (ObjectLayer, error) {
err = initBucketPolicies(objAPI)
fatalIf(err, "Unable to load all bucket policies.")
// Initialize a new event notifier.
err = initEventNotifier(objAPI)
fatalIf(err, "Unable to initialize event notification.")
// Success.
return objAPI, nil
}