Hotfix/0.10 deadlock #43
Merged
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.
Sorry for not written in English
기존에 피어목록을 갱신(추가,삭제) 하는 것이 채널을 사용해 하나씩 동기화 처리 방식으로 했는데, 개별 피어의 기본 동작용 고루틴과 피어매니저의 관리자 고루틴 사에 채널로 넘기는 부분에서 순환 데드락 같은 현상이 발생하면서 p2p전체의 동작도 멈추게 되는 사태가 발생했었습니다.
이 부분을 피어 동작을 멈추고 매니저에서 삭제하는 부분을 비동기 처리로 바꾸고 삭제하는 것을 채널로 일렬화시키는 게 없어도 될 걸로 보여 해당 부분 채널을 삭제하였습니다.
자체 테스트는 했지만 실제 문제가 발생한 tx과다유입으로 그래서 피어가 반강제로 접속을 끊으면서 데드락이 발생하는 증상은 직접 재연테스트가 어려워서 이 부분 테스트를 마치고 커밋을 병합하면 좋겠습니다.