fs: Fix Shutdown() behavior and handle tests properly. (#4796)

Fixes #4795
This commit is contained in:
Harshavardhana authored and Dee Koder committed 2017-08-10 14:11:57 -07:00
1 parent e7cdd8f02c
commit 3544e5ad01
5 files changed
+126 -38

No files matched your search

+4 -2
View File
@@ -157,8 +157,8 @@ func newFSObjectLayer(fsPath string) (ObjectLayer, error) {
return nil, fmt.Errorf("Unable to initialize event notification. %s", err)
}
// Start background process to cleanup old files in minio.sys.tmp
go fs.cleanupStaleMultipartUploads()
// Start background process to cleanup old files in `.minio.sys`.
go fs.cleanupStaleMultipartUploads(fsMultipartCleanupInterval, fsMultipartExpiry, globalServiceDoneCh)
// Return successfully initialized object layer.
return fs, nil
@@ -166,6 +166,8 @@ func newFSObjectLayer(fsPath string) (ObjectLayer, error) {
// Should be called when process shuts down.
func (fs fsObjects) Shutdown() error {
fs.fsFormatRlk.Close()
// Cleanup and delete tmp uuid.
return fsRemoveAll(pathJoin(fs.fsPath, minioMetaTmpBucket, fs.fsUUID))
}