Skip to content

Commit

Permalink
Fix a deadlock scenario in envfiles usage
Browse files Browse the repository at this point in the history
  • Loading branch information
saich authored and yhlee-aws committed Aug 19, 2020
1 parent a21516a commit d066526
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agent/taskresource/envFiles/envfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ func (envfile *EnvironmentFileResource) Initialize(resourceFields *taskresource.
taskKnownStatus status.TaskStatus,
taskDesiredStatus status.TaskStatus) {
envfile.lock.Lock()
defer envfile.lock.Unlock()

envfile.initStatusToTransition()
envfile.credentialsManager = resourceFields.CredentialsManager
envfile.s3ClientCreator = factory.NewS3ClientCreator()
envfile.ioutil = ioutilwrapper.NewIOUtil()
envfile.bufio = bufiowrapper.NewBufio()
envfile.lock.Unlock()

// if task isn't in 'created' status and desired status is 'running',
// reset the resource status to 'NONE' so we always retrieve the data
Expand Down

0 comments on commit d066526

Please sign in to comment.