Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
UpdateAssociatedObjectList
함수의 "delete" 파트에는 여전히 SJSON 을 사용하도록 두었습니다.UpdateAssociatedObjectList
함수의 "delete" 파트는 문제 없이 동작하고 있습니다.이 PR로 업데이트되는
UpdateAssociatedObjectList
함수의 "add" 파트와 관련이 있습니다.[문제에 대한 설명]
현재
test/official/sequentialFullTest/testAll-mcis-mcir-ns-cloud.sh
스크립트는3개의 VM으로 구성되는 1개의 MCIS를 생성합니다.
❯ ./testAll-mcis-mcir-ns-cloud.sh mock 1 jhseo
이 스크립트를 실행하면, 먼저
5종류의 CB-Tumblebug MCIR object 를 1개씩 생성하고,
이후 3개의 VM으로 구성되는 1개의 MCIS를 생성하면서
위에서 생성한 MCIR 들의
associatedObjectList
필드를 업데이트 합니다.그러므로,
associatedObjectList
필드에는 VM 3개의 key가 기록되어 있어야 정상입니다.❯ ./list-image.sh
문제는, key가 3개 기록되는 경우도 있고, 간헐적으로 key가 2개 기록되는 경우도 있다는 것입니다.
❯ ./list-image.sh
[다른 회차]
❯ ./list-image.sh
[추정]
CreateMcis
함수는 goroutine 을 사용하여AddVmToMcis
함수를 실행합니다.AddVmToMcis
=>CreateVm
=>UpdateAssociatedObjectList
의 콜체인이 있습니다.UpdateAssociatedObjectList
의 "add" 부분 안에,associatedObjectList
리스트를 읽고 쓰는 동작이 있습니다.associatedObjectList
리스트에 대한 락이 없기 때문에, 이런 현상이 생기는 것으로 추정합니다.jhseo-0
과jhseo-1
을 기록하려고 하면,거의 동시에
UpdateAssociatedObjectList
함수가 실행되고,이 함수 인스턴스에서
associatedObjectList
리스트를 Key-Value store 에서 읽으면두 함수 인스턴스 모두에서
associatedObjectList
리스트가 비어 있는 것으로 나옴.두 함수 인스턴스가 각각
jhseo-0
과jhseo-1
을 기록하고 Key-Value store 에 저장하면,둘 중 빨리 수행된 쪽의 결과만 남게 됨