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

Handle exception at send #6459

Merged
merged 16 commits into from
Dec 14, 2022

Conversation

HenrikJannsen
Copy link
Collaborator

@HenrikJannsen HenrikJannsen commented Dec 13, 2022

This PR carries maybe a bit of risk as we did not handle exceptions at send message before. Now the onFailure handler is called. Before the onSuccess was called. There might be some unintended effects from that. If discovered we should fix that as now it uses the correct behaviour.

Based on #6458

…call on connection is blocking.

This was likely a major bug for seed nodes that at sending hash responses the main thread got blocked.

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
… of the executor in NetworkNode.

We use double the maxConnection size for the core size and 4x for the max pool size.

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
…ire a jvm option to allow it.

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
It is more convenient to handle the RejectedExecutionException in the calling code to get more context for error logging.

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
…kingQueue.

When ArrayBlockingQueue is used (as in case of using Utilities.getListeningExecutorService) the maxPoolSize
has no effect. The pool creates never more threads than the core pool size.
Thus we have been limited to 15 threads for message sending and connection creation.
This was likely a reason why seed nodes are not accepting new connections if the pool is exhausted.
Slow message send can block a thread for 1-3 minutes.

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
Make sendMessage package scope to not be used from client code.
Remove stacktrace print.

The caller in NetworkNode would report a onSuccess in the future callback because we do not escalate the exception but only handle it inside handleException.

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
…r instead.

Make executorService protected final

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
… class.

Remove torStartupFuture as it was not needed.
Make executorService private and add shutdownNow call.

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
Wrap nodeAddressProperty.set into UserThread.execute as it is a javafx api. We call startServer also in that execute scope to maintain order of calls.

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
Add name param to newCachedThreadPool

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
@ripcurlx ripcurlx added this to the v1.9.7 milestone Dec 14, 2022
@ripcurlx
Copy link
Contributor

I'd be fine merging this into the release branch and do more extensive release testing.

Copy link
Contributor

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

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

utACK

@ripcurlx ripcurlx merged commit 5dea677 into bisq-network:master Dec 14, 2022
@HenrikJannsen HenrikJannsen deleted the handle_exception_at_send branch December 14, 2022 20:23
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.

2 participants