Skip to content

InternalConnectorRegistry.java uses non-daemon threads #2119

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

Closed
kgala2 opened this issue Feb 24, 2025 · 0 comments · Fixed by #2118
Closed

InternalConnectorRegistry.java uses non-daemon threads #2119

kgala2 opened this issue Feb 24, 2025 · 0 comments · Fixed by #2118
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Comments

@kgala2
Copy link
Contributor

kgala2 commented Feb 24, 2025

For InternalConnectorRegistry, it uses non-daemon threads which prevents normal shutdown of our application.
It seems like even error on the main thread does not terminate the process now with the connector, so we have batch jobs that fail and linger in this zombie state.

In order to create daemon threads, creation of executors should be changed to something like

this.executor = MoreExecutors.listeningDecorator(
    Executors.newScheduledThreadPool(8, r -> {
        Thread t = new Thread(r);
        t.setDaemon(true);
        return t;
    })
);

#2118
similar issue: GoogleCloudPlatform/alloydb-java-connector/issues/617

@kgala2 kgala2 added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Feb 24, 2025
@kgala2 kgala2 self-assigned this Feb 24, 2025
@kgala2 kgala2 linked a pull request Feb 24, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant