Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: allNodes concurrency ploblem. #838

Closed
wants to merge 1 commit into from

Conversation

brido4125
Copy link
Collaborator

🔗 Related Issue

N / A

⌨️ What I did

brocast 연산 호출 시 locator의 getAllNodes가 호출된다.
brocast의 getAllNodes()와 캐시 리스트 update가 함께 발생하면
하나의 ArrayList에 대해 read / write가 동시에 발생하여 문제가 발생한다.

이를 방지하기 위해 allNodes 인스턴스의
데이터 타입을 CopyOnWriteArrayList로 변경하였다.

@brido4125 brido4125 self-assigned this Oct 31, 2024
@jhpark816 jhpark816 requested a review from uhm0311 October 31, 2024 01:47
@uhm0311
Copy link
Collaborator

uhm0311 commented Oct 31, 2024

지난번에도 비슷한 PR이 있지 않았나요?

@brido4125
Copy link
Collaborator Author

brido4125 commented Oct 31, 2024

@uhm0311

아래 PR이긴 한데 현재 구현이 locator에
영향을 주지 않아 더 간결하다고 생각됩니다.

#769
(delay된 이유가 locator에 영향을 많이 주는 구현이라 delay 시켰었네요)
본 PR 머지되면 위에도 close 하겠습니다

@uhm0311
Copy link
Collaborator

uhm0311 commented Oct 31, 2024

저는 CopyOnWriteArrayList를 사용하는 것보단 과거 PR처럼 Replace 방식을 사용하는 것이 더 나아 보입니다.

@brido4125
Copy link
Collaborator Author

close하고 이미 생성된 PR의
replace 방식을 사용하겠습니다.

@brido4125 brido4125 closed this Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants