Skip to content

Commit 65cfb99

Browse files
fix: Update SystemExecutors to only use 4 threads, always (#1209)
This can cause contention issues on high-core-count machines Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-pubsublite/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> ☕️ If you write sample code, please follow the [samples format]( https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md).
1 parent ae60131 commit 65cfb99

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ If you are using Maven, add this to your pom.xml file:
3232
If you are using Gradle without BOM, add this to your dependencies:
3333

3434
```Groovy
35-
implementation 'com.google.cloud:google-cloud-pubsublite:1.6.3'
35+
implementation 'com.google.cloud:google-cloud-pubsublite:1.7.0'
3636
```
3737

3838
If you are using SBT, add this to your dependencies:
3939

4040
```Scala
41-
libraryDependencies += "com.google.cloud" % "google-cloud-pubsublite" % "1.6.3"
41+
libraryDependencies += "com.google.cloud" % "google-cloud-pubsublite" % "1.7.0"
4242
```
4343

4444
## Authentication

google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/internal/wire/SystemExecutors.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ private static ThreadFactory newDaemonThreadFactory(String prefix) {
3333

3434
public static ScheduledExecutorService newDaemonExecutor(String prefix) {
3535
ScheduledThreadPoolExecutor executor =
36-
new ScheduledThreadPoolExecutor(
37-
Math.max(4, Runtime.getRuntime().availableProcessors()),
38-
newDaemonThreadFactory(prefix));
36+
new ScheduledThreadPoolExecutor(4, newDaemonThreadFactory(prefix));
3937
// Remove scheduled tasks from the executor as soon as they are cancelled.
4038
executor.setRemoveOnCancelPolicy(true);
4139
return executor;

0 commit comments

Comments
 (0)