Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Fix race condition in WebSocketService #1021

Merged
merged 2 commits into from
Mar 4, 2019

Conversation

ajsutton
Copy link
Contributor

@ajsutton ajsutton commented Mar 1, 2019

PR description

WebSocketService was accessing httpServer from a handler that is setup as part of initing httpServer so if the handler was called quickly it may fail with a NullPointerException because httpServer hasn't actually been assigned yet (or the assignment isn't visible to the other thread). The httpServer value is available as the result passed into the handler anyway so use that instead.

Copy link
Contributor

@lucassaldanha lucassaldanha left a comment

Choose a reason for hiding this comment

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

LGTM

@ajsutton ajsutton merged commit 5e87354 into PegaSysEng:master Mar 4, 2019
@ajsutton ajsutton deleted the websocketserver-race branch March 4, 2019 05:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants