Skip to content

Commit

Permalink
Add read lock to task ToString method
Browse files Browse the repository at this point in the history
  • Loading branch information
mye956 committed Aug 16, 2024
1 parent 177dbd2 commit 8b53921
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ jobs:
run: |
set -eoux pipefail
export GOPATH=$GITHUB_WORKSPACE
cd $GITHUB_WORKSPACE/src/github.com/aws/amazon-ecs-agent
make test-silent
make analyze-cover-profile
make test-init
make analyze-cover-profile-init
cd $GITHUB_WORKSPACE/src/github.com/aws/amazon-ecs-agent/agent/engine
go test -v -tags unit -run TestTaskWithCircularDependency -count 500
# make test-silent
# make analyze-cover-profile
# make test-init
# make analyze-cover-profile-init
3 changes: 3 additions & 0 deletions agent/api/task/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -2910,6 +2910,9 @@ func (task *Task) GetExecutionStoppedAt() time.Time {

// String returns a human-readable string representation of this object
func (task *Task) String() string {
task.lock.RLock()
defer task.lock.RUnlock()

return task.stringUnsafe()
}

Expand Down

0 comments on commit 8b53921

Please sign in to comment.