Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Make all thread pools create daemon threads #2010

Merged
merged 1 commit into from
Nov 4, 2019
Merged

Conversation

elefeint
Copy link
Contributor

@elefeint elefeint commented Nov 4, 2019

Currently the thread pool for Pub/Sub's SubscriberStub keeps JVM from shutting down, causing non-web application to "hang".

This PR makes all Spring Cloud GCP threads daemon threads that do not prevent a Spring application from stopping.

This is a change in behavior for Pub/Sub-dependent command line applications that subscribe to a Pub/Sub topic with PubSubTemplate.subscribe(), and expect the application to run until externally terminated.

Fixes #2005.

@codecov
Copy link

codecov bot commented Nov 4, 2019

Codecov Report

Merging #2010 into master will decrease coverage by 7.97%.
The diff coverage is 80%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master   #2010      +/-   ##
===========================================
- Coverage     80.37%   72.4%   -7.98%     
+ Complexity     2115    1879     -236     
===========================================
  Files           243     243              
  Lines          6895    6900       +5     
  Branches        709     709              
===========================================
- Hits           5542    4996     -546     
- Misses         1058    1576     +518     
- Partials        295     328      +33
Flag Coverage Δ Complexity Δ
#integration ? ?
#unittests 72.4% <80%> (ø) 1879 <0> (ø) ⬇️
Impacted Files Coverage Δ Complexity Δ
...configure/vision/CloudVisionAutoConfiguration.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...toconfigure/pubsub/GcpPubSubAutoConfiguration.java 90.83% <100%> (+0.21%) 38 <0> (ø) ⬇️
...igure/trace/StackdriverTraceAutoConfiguration.java 69.49% <100%> (+0.52%) 10 <0> (ø) ⬇️
...a/spanner/repository/query/SpannerQueryMethod.java 0% <0%> (-100%) 0% <0%> (-6%)
...ository/config/FirestoreRepositoriesRegistrar.java 0% <0%> (-100%) 0% <0%> (-3%)
...sitory/support/FirestoreRepositoryFactoryBean.java 0% <0%> (-100%) 0% <0%> (-4%)
...pository/support/FirestoreQueryLookupStrategy.java 0% <0%> (-100%) 0% <0%> (-2%)
...figure/config/GcpConfigBootstrapConfiguration.java 0% <0%> (-100%) 0% <0%> (-2%)
...restore/repository/query/FirestoreQueryMethod.java 0% <0%> (-100%) 0% <0%> (-2%)
...ository/config/DatastoreRepositoriesRegistrar.java 0% <0%> (-100%) 0% <0%> (-3%)
... and 52 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ce9877...3840092. Read the comment docs.

Copy link
Contributor

@meltsufin meltsufin left a comment

Choose a reason for hiding this comment

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

Thanks!

* @since 1.2
*/
@RunWith(MockitoJUnitRunner.class)
public class PubSubSubscriberTemplateTests {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wasn't this part of some other PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

... and this is why it's a best practice to delete branches after merging to master ...
// shame cube

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

gcp-pubsub-subscriber thread starts on PubSubTemplate creation; never stops
2 participants