Revert "Revert "tests: Add context cancelation (#15374)""

This reverts commit 564a0afae1.
This commit is contained in:
Harshavardhana
2022-10-14 03:08:40 -07:00
parent 59e33b3b21
commit 6cb2f56395
21 changed files with 133 additions and 67 deletions

View File

@@ -241,11 +241,11 @@ func serverHandleEnvVars() {
var globalHealStateLK sync.RWMutex
func initAllSubsystems() {
func initAllSubsystems(ctx context.Context) {
globalHealStateLK.Lock()
// New global heal state
globalAllHealState = newHealState(true)
globalBackgroundHealState = newHealState(false)
globalAllHealState = newHealState(ctx, true)
globalBackgroundHealState = newHealState(ctx, false)
globalHealStateLK.Unlock()
// Initialize notification peer targets
@@ -263,7 +263,7 @@ func initAllSubsystems() {
}
// Create the bucket bandwidth monitor
globalBucketMonitor = bandwidth.NewMonitor(GlobalContext, totalNodeCount())
globalBucketMonitor = bandwidth.NewMonitor(ctx, totalNodeCount())
// Create a new config system.
globalConfigSys = NewConfigSys()
@@ -450,7 +450,7 @@ func serverMain(ctx *cli.Context) {
initHelp()
// Initialize all sub-systems
initAllSubsystems()
initAllSubsystems(GlobalContext)
// Is distributed setup, error out if no certificates are found for HTTPS endpoints.
if globalIsDistErasure {
@@ -696,7 +696,7 @@ func newObjectLayer(ctx context.Context, endpointServerPools EndpointServerPools
// For FS only, directly use the disk.
if endpointServerPools.NEndpoints() == 1 {
// Initialize new FS object layer.
newObject, err = NewFSObjectLayer(endpointServerPools[0].Endpoints[0].Path)
newObject, err = NewFSObjectLayer(ctx, endpointServerPools[0].Endpoints[0].Path)
if err == nil {
return newObject, nil
}