Skip to content

Conversation

@dgolombek
Copy link

As described in #164, I see a NPE in complete() that I believe is caused by a race here onComplete() is called in between where provideChannelContext() sets state to IDLE and when subscriber.onSubscribe() gets around to setting the subscriber. A full fix to that race is tricky, but this null check is safe. That race could leave the publisher in a bad state, but since the handler has been removed by that point, it shouldn't matter.

fixes #164

As described in playframework#164, I see a NPE in complete() that I believe is
caused by a race here onComplete() is called in between where
provideChannelContext() sets state to IDLE and when
subscriber.onSubscribe() gets around to setting the subscriber. A full
fix to that race is tricky, but this null check is safe. That race
could leave the publisher in a bad state, but since the handler has
been removed by that point, it shouldn't matter.

fixes playframework#164
Copy link
Member

@mkurz mkurz left a comment

Choose a reason for hiding this comment

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

Thanks, makes sense to me 👍

@mkurz mkurz merged commit bb19055 into playframework:main Nov 17, 2022
@dgolombek dgolombek deleted the handlerRemoved_npe branch November 17, 2022 14:13
@mkurz
Copy link
Member

mkurz commented Nov 17, 2022

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.

NPE in HandlerPublisher.handlerRemoved

2 participants