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

Client should not shutdown provided executor #2035

Open
OlegMazurov opened this issue Oct 11, 2024 · 4 comments
Open

Client should not shutdown provided executor #2035

OlegMazurov opened this issue Oct 11, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@OlegMazurov
Copy link

Description

#1844 introduced a new API that allowed creating Clients with an external Executor.
Multiple Clients can now share the same executor.
However, when a Client is closed it shuts down its executor no matter whether it was provided or created by the client itself.
That affects multiple clients sharing the same executor, reusing the executor for a client that had to be restarted, and lots of other scenarios where users assume control over their executor.

Steps to reproduce

  • Create two Clients with the same external executor
  • Close one Client
  • Continue using the second Client

Additional context

No response

Hedera network

other

Version

2.39.0

Operating system

Linux

@OlegMazurov OlegMazurov added the bug Something isn't working label Oct 11, 2024
@0xivanov
Copy link
Contributor

Hi Oleg, you could use client.closeChannels();, which will not shutdown the executor.

@OlegMazurov
Copy link
Author

This is counterintuitive from the API point of view and I expect every developer to fall for it. I'll update my client code as suggested. However, the point that SDK should not close user provided executor is still valid.

@steffenboe
Copy link
Contributor

steffenboe commented Oct 18, 2024

@0xivanov would a solution be to track if the executor was user-provided or not, and in the former case, do not close it?

@0xivanov
Copy link
Contributor

@steffenboe Yes, we could do that. If you feel like doing this, I don't have any problems with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants