Project

General

Profile

Actions

Bug #7900

closed

[Data Manager] Fix data races in datamanager code

Added by Radhika Chippada over 10 years ago. Updated over 9 years ago.

Status:
Rejected
Priority:
Normal
Assigned To:
-
Category:
-
Target version:
-
Story points:
-

Description

Using xx_test="-race" when running a go test shows if there are any data races in the code.

For ex: ./run-tests.sh --leave-temp --temp /tmp/tmp.dP1jU9V6bb WORKSPACE=~/arvados --skip-install --only services/datamanager services/datamanager_test="-race -test.v"

Actions #1

Updated by Radhika Chippada over 10 years ago

  • Subject changed from [Data Manager] Fix races in datamanager code to [Data Manager] Fix data races in datamanager code
  • Description updated (diff)
Actions #2

Updated by Radhika Chippada over 10 years ago

It appears that there is one race in keep/keep.go

./run-tests.sh --leave-temp --temp /tmp/tmp.dP1jU9V6bb WORKSPACE=~/arvados --skip-install --only services/datamanager/keep services/datamanager/keep_test="-race -test.v"

It seems like this is happening in the goroutine for SendTrashLists (and the potential fix for it)

/*
            pipeReader, pipeWriter := io.Pipe()
            go (func() {
                enc := json.NewEncoder(pipeWriter)
                enc.Encode(v)
                pipeWriter.Close()
            })()

            req, err := http.NewRequest("PUT", fmt.Sprintf("%s/trash", url), pipeReader)
*/

            enc, _ := json.Marshal(v)
            req, err := http.NewRequest("PUT", fmt.Sprintf("%s/trash", url), bytes.NewBufferString(string(enc)))
Actions #3

Updated by Tom Clegg over 9 years ago

  • Status changed from New to Rejected
Actions

Also available in: Atom PDF