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 scenario where a call to getPeerHandler would always throw #254

Merged
merged 1 commit into from
Aug 19, 2022

Conversation

jimmygchen
Copy link
Contributor

@jimmygchen jimmygchen commented Aug 18, 2022

Attempt to fix an issue where stream.getPeerHandler is called even when steam is closed on initialization, which would always throw due to peerHandler not being set, as documented in P2PService.closeAbruptly

image

Avoiding the stream.getPeerHandler call in the case where stream.aborted == true should prevent this error.

Issue raised in Teku:
Consensys/teku#6088

ps. I'm not familiar with the code base at all - so my investigation and guess may well be incorrect. I'm looking for a way to test this - any suggestions / ideas on how to do this is appreciated!

Fix an issue where `stream.getPeerHandler` is called even when steam is closed on initialization, which would always throw due to
 `peerHandler` not being set
@jimmygchen jimmygchen changed the title Fix scenario where a call getPeerHandler would always throw Fix scenario where a call to getPeerHandler would always throw Aug 18, 2022
Copy link
Collaborator

@Nashatyrev Nashatyrev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jimmygchen good catch! Thanks for the fix!
LGTM

@Nashatyrev Nashatyrev merged commit 8a41192 into libp2p:develop Aug 19, 2022
@Nashatyrev
Copy link
Collaborator

The regression was introduced with #247

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