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 unhandled exception #7743

Merged
merged 8 commits into from
Oct 9, 2024
Merged

Conversation

pinges
Copy link
Contributor

@pinges pinges commented Oct 8, 2024

PR description

Fixes an unhandled exception:

{"@timestamp":"2024-10-08T01:07:36,808","level":"ERROR","thread":"vert.x-eventloop-thread-3","class":"ContextImpl","message":"Unhandled exception","throwable":" java.util.NoSuchElementException\n\tat 1.next(CircularFifoQueue.java:385)\n\tat java.base/java.util.AbstractCollection.contains(AbstractCollection.java:112)\n\tat org.hyperledger.besu.ethereum.p2p.discovery.internal.PeerTable.isIpAddressInvalid(PeerTable.java:217)\n\tat

Fixes #7733

Copy link
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

can you add a test to show the problem that is fixed

@pinges
Copy link
Contributor Author

pinges commented Oct 8, 2024

can you add a test to show the problem that is fixed

That is really hard, as the problem was a race condition.
In the code we were iterating over the collection, checking hasNext(), then getNext(). In the Implementation of getNext() in the collection the first thing that is done is checking hasNext(), which failed and threw the NoSuchElementException.

@@ -28,6 +28,7 @@
- Corrects a regression where custom plugin services are not initialized correctly. [#7625](https://github.com/hyperledger/besu/pull/7625)
- Fix for IBFT2 chains using the BONSAI DB format [#7631](https://github.com/hyperledger/besu/pull/7631)
- Fix reading `tx-pool-min-score` option from configuration file [#7623](https://github.com/hyperledger/besu/pull/7623)
- Fix an undhandled exception. [#7733](https://github.com/hyperledger/besu/issues/7733)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
- Fix an undhandled exception. [#7733](https://github.com/hyperledger/besu/issues/7733)
- Fix an unhandled exception. [#7733](https://github.com/hyperledger/besu/issues/7733)

Copy link
Contributor

@siladu siladu left a comment

Choose a reason for hiding this comment

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

LGTM

@macfarla
Copy link
Contributor

macfarla commented Oct 9, 2024

can you add a test to show the problem that is fixed

That is really hard, as the problem was a race condition. In the code we were iterating over the collection, checking hasNext(), then getNext(). In the Implementation of getNext() in the collection the first thing that is done is checking hasNext(), which failed and threw the NoSuchElementException.

ok fair enough

@pinges pinges merged commit 11a62a0 into hyperledger:main Oct 9, 2024
43 checks passed
@pinges pinges deleted the fixUnhandledException branch October 9, 2024 03:36
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.

Unhandled exception - PeerDiscoveryController
4 participants