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

FISH-5851 Prevent NullPointerException in com.sun.jts.CosTransactions.RecoveryManager #5492

Merged
merged 2 commits into from
Nov 16, 2021

Conversation

chrjohn
Copy link
Contributor

@chrjohn chrjohn commented Nov 8, 2021

Fixes #5491

Make a copy of the EventSemaphore before accessing it.

Description

Prevents NPE in com.sun.jts.CosTransactions.RecoveryManager by making a copy of the EventSemaphore. This was suggested by @pdudits in https://forum.payara.fish/t/nullpointerexception-in-com-sun-jts-costransactions-recoverymanager-when-restoring-ejb-timers/81

Important Info

Testing

This is a race condition which occurs very rarely. We only encountered this once in several years.
However, if anyone has an idea for a test I'd be happy to work on it.

Testing Performed

n/a

Testing Environment

n/a

Documentation

n/a

Notes for Reviewers

n/a

Make a copy of the EventSemaphore before checking its state.
@AlanRoth AlanRoth self-requested a review November 9, 2021 09:17
@AlanRoth AlanRoth added PR: Awaiting CLA Contributor does not have a CLA or has submitted an unconfirmed CLA. Type: Community Contribution labels Nov 9, 2021
@AlanRoth
Copy link

AlanRoth commented Nov 9, 2021

Hi, @chrjohn

Thank you for the PR, we're happy to receive your contribution, before we can proceed you will need to sign the CLA and send it to us.

Payara CLA

Thank you,
Alan

@AlanRoth
Copy link

AlanRoth commented Nov 9, 2021

jenkins test please

@AlanRoth AlanRoth removed their request for review November 9, 2021 09:24
@AlanRoth AlanRoth self-assigned this Nov 9, 2021
@AlanRoth AlanRoth requested a review from pdudits November 9, 2021 09:29
Copy link
Contributor

@pdudits pdudits left a comment

Choose a reason for hiding this comment

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

When verifying the changes I noted two methods in EventSemaphore that are not used:

EventSemaphore(boolean) and EventSemaphore.clear.

It would be good to delete those as well, so it is clear that EventSemaphore only transitions once, from false to true

@chrjohn
Copy link
Contributor Author

chrjohn commented Nov 9, 2021

@pdudits , thanks, will do.

@breakponchito breakponchito self-requested a review November 9, 2021 17:09
Copy link
Contributor

@breakponchito breakponchito left a comment

Choose a reason for hiding this comment

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

LGTM

@AlanRoth AlanRoth changed the title Prevent NullPointerException in com.sun.jts.CosTransactions.RecoveryManager FISH-5851 Prevent NullPointerException in com.sun.jts.CosTransactions.RecoveryManager Nov 10, 2021
@smillidge smillidge added PR: CLA CLA submitted on PR by the contributor and removed PR: Awaiting CLA Contributor does not have a CLA or has submitted an unconfirmed CLA. labels Nov 10, 2021
@smillidge
Copy link
Contributor

Thanks we have the CLA

@AlanRoth
Copy link

jenkins test please

@AlanRoth AlanRoth merged commit 125c82f into payara:master Nov 16, 2021
@chrjohn chrjohn deleted the issue-5491 branch November 16, 2021 13:24
aubi pushed a commit to aubi/Payara that referenced this pull request Jan 3, 2022
FISH-5851 Prevent NullPointerException in `com.sun.jts.CosTransactions.RecoveryManager`
JamesHillyard pushed a commit to JamesHillyard/Payara that referenced this pull request Jan 24, 2022
FISH-5851 Prevent NullPointerException in `com.sun.jts.CosTransactions.RecoveryManager`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: CLA CLA submitted on PR by the contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug Report: NullPointerException in com.sun.jts.CosTransactions.RecoveryManager / FISH-5851
5 participants