Ignore: ๐ Distributed Lock Failure Causing Duplicate Chat Room Joins #236
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.
์์ ์ด์
Initially, I thought the issue was due to a missing validation check for users already joined in a chat room, so I added it. However, after further investigation, I realized that the problem lies elsewhere. (I haven't found the root cause yet.)
์์ ์ฌํญ
I found the root cause of the issue through debuggingโduplicate user entries were saved in the chat room.
However, this shouldnโt be possible
I had already anticipated this issue and applied a distributed lock at the service level.
Additionally, the validation to check for duplicate users was being executed in
ChatMemberRdbService.createMember()
But it still failed.
Logs Analysis
These logs clearly indicate that two threads acquired the lock simultaneously. ๐๐๐
Iโve been trying to reproduce the issue under the same conditions, but I haven't been able to.
๋ฆฌ๋ทฐ์ด๊ฐ ์ค์ ์ ์ผ๋ก ํ์ธํด์ผ ํ๋ ๋ถ๋ถ
๋ฐ๊ฒฌํ ์ด์