googleapis / gax-java

This library has moved to https://github.com/googleapis/sdk-platform-java/tree/main/gax-java.
https://github.com/googleapis/gapic-generator-java/tree/main/gax-java
BSD 3-Clause "New" or "Revised" License
162 stars 119 forks source link

fix: Watchdog controls lifecycle of the future, not executor #1890

Closed meltsufin closed 1 year ago

meltsufin commented 1 year ago

Watchdog should not control the lifecycle of the provided executor. As a BackgroundResource, it should only unschedule itself from the executor if asked to be shutdown. I believe this is more aligned with the intent #828 without surprising side effects on the lifecycle of the executor that is not controlled by the Watchdog or the WatchdogProvider.

Fixes #1858.

cc/ @igorbernstein2

Other approaches considered: #1875 , #1883. Will add unit tests in a separate PR. Further improvement: #1884.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication