You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2018/02/07 15:45:47 UTC

httpcomponents-core git commit: [HTTPCORE-510] Avoid an ArithmeticException in AbstractMultiworkerIOReactor by failing earlier by checking ioThreadCount in IOReactorConfig constructor. [HTTPCORE-511] Do not cache result of Runtime.getRuntime().availableP [Forced Update!]

Repository: httpcomponents-core
Updated Branches:
  refs/heads/master 8d938a656 -> 07f436a5a (forced update)


[HTTPCORE-510] Avoid an ArithmeticException in AbstractMultiworkerIOReactor by failing earlier by checking ioThreadCount in IOReactorConfig constructor.
[HTTPCORE-511] Do not cache result of Runtime.getRuntime().availableProcessors() in IOReactorConfig.


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/07f436a5
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/07f436a5
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/07f436a5

Branch: refs/heads/master
Commit: 07f436a5a5ec0bc87e7213531076be461848d2e2
Parents: 5739fb6
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Feb 6 12:21:56 2018 -0700
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Wed Feb 7 16:41:19 2018 +0100

----------------------------------------------------------------------
 RELEASE_NOTES.txt                                      | 13 +++++++++++++
 .../org/apache/hc/core5/reactor/IOReactorConfig.java   |  6 ++----
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/07f436a5/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 48e60df..4fc6feb 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,3 +1,16 @@
+Release 5.0-BETA3
+-------------------
+
+This BETA release fixes a number of defects found since the previous release and
+adds several incremental improvements.
+
+* HTTPCORE-510: Avoid an ArithmeticException in AbstractMultiworkerIOReactor by failing earlier by checking ioThreadCount in IOReactorConfig constructor.
+  Contributed by Gary Gregory <ggregory at apache.org>
+
+* HTTPCORE-511: Do not cache result of Runtime.getRuntime().availableProcessors() in IOReactorConfig.
+  Contributed by Gary Gregory <ggregory at apache.org>
+
+
 Release 5.0-BETA2
 -------------------
 

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/07f436a5/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorConfig.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorConfig.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorConfig.java
index 63a5a9d..58e9754 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorConfig.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorConfig.java
@@ -43,8 +43,6 @@ import org.apache.hc.core5.util.Timeout;
 @Contract(threading = ThreadingBehavior.IMMUTABLE)
 public final class IOReactorConfig {
 
-    private static final int AVAIL_PROCS = Runtime.getRuntime().availableProcessors();
-
     public static final IOReactorConfig DEFAULT = new Builder().build();
 
     private final long selectInterval;
@@ -71,7 +69,7 @@ public final class IOReactorConfig {
             final int backlogSize) {
         super();
         this.selectInterval = selectInterval;
-        this.ioThreadCount = ioThreadCount;
+        this.ioThreadCount = Args.positive(ioThreadCount, "ioThreadCount");
         this.soTimeout = soTimeout;
         this.soReuseAddress = soReuseAddress;
         this.soLinger = soLinger;
@@ -229,7 +227,7 @@ public final class IOReactorConfig {
 
         Builder() {
             this.selectInterval = 1000;
-            this.ioThreadCount = AVAIL_PROCS;
+            this.ioThreadCount = Runtime.getRuntime().availableProcessors();
             this.soTimeout = Timeout.ZERO_MILLISECONDS;
             this.soReuseAddress = false;
             this.soLinger = TimeValue.NEG_ONE_SECONDS;