Use workaround to fix high CPU usage by LinkedTransferQueue (#3756)

This is a workaround for JDK-8301341 by using the Java 11 LinkedTransferQueue with the QueueingThreadPoolExecutor in the Core and jUPnP.

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born 2023-08-14 10:37:20 +02:00 committed by GitHub
parent c12067a63b
commit aef57edd73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 95 additions and 31 deletions

View File

@ -202,7 +202,8 @@
<dependency>
<groupId>org.jupnp</groupId>
<artifactId>org.jupnp</artifactId>
<version>2.7.1</version>
<!-- Uses the Java 11 LinkedTransferQueue as workaround for JDK-8301341 -->
<version>2.7.1.OH1</version>
<scope>compile</scope>
</dependency>
@ -436,6 +437,14 @@
<version>5.12.1</version>
<scope>compile</scope>
</dependency>
<!-- Provides the Java 11 LinkedTransferQueue used in workarounds for JDK-8301341 -->
<dependency>
<groupId>org.openhab</groupId>
<artifactId>base-fixes</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -469,7 +469,8 @@
<dependency>
<groupId>org.jupnp</groupId>
<artifactId>org.jupnp</artifactId>
<version>2.7.1</version>
<!-- Uses the Java 11 LinkedTransferQueue as workaround for JDK-8301341 -->
<version>2.7.1.OH1</version>
<scope>compile</scope>
</dependency>
@ -1090,6 +1091,14 @@
<version>5.12.1</version>
<scope>compile</scope>
</dependency>
<!-- Provides the Java 11 LinkedTransferQueue used in workarounds for JDK-8301341 -->
<dependency>
<groupId>org.openhab</groupId>
<artifactId>base-fixes</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -13,7 +13,6 @@
package org.openhab.core.common;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedTransferQueue;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
@ -24,6 +23,7 @@ import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.function.Consumer;
import org.openhab.basefixes.util.concurrent.LinkedTransferQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -40,6 +40,7 @@
<requirement>openhab.tp;filter:="(feature=jna)"</requirement>
<feature dependency="true">openhab.tp-jna</feature>
<bundle>mvn:org.openhab/base-fixes/1.0.0</bundle>
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.automation/${project.version}</bundle>
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.config.core/${project.version}</bundle>
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.config.discovery/${project.version}</bundle>

View File

@ -212,7 +212,8 @@
<feature dependency="true">http</feature>
<feature dependency="true">scr</feature>
<feature dependency="true">openhab.tp-httpclient</feature>
<bundle>mvn:org.jupnp/org.jupnp/2.7.1</bundle>
<bundle>mvn:org.openhab/base-fixes/1.0.0</bundle>
<bundle>mvn:org.jupnp/org.jupnp/2.7.1.OH1</bundle>
</feature>
<feature name="openhab.tp-lsp4j" description="Eclipse LSP4J" version="${project.version}">

View File

@ -60,4 +60,5 @@ Fragment-Host: org.openhab.core.addon
org.openhab.core.addon;version='[4.1.0,4.1.1)',\
org.openhab.core.addon.tests;version='[4.1.0,4.1.1)',\
org.openhab.core.config.core;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)'
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)'

View File

@ -68,4 +68,6 @@ Fragment-Host: org.openhab.core.auth.oauth2client
org.openhab.core.auth.oauth2client.tests;version='[4.1.0,4.1.1)',\
org.openhab.core.io.console;version='[4.1.0,4.1.1)',\
org.openhab.core.io.net;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)'
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -66,4 +66,6 @@ Fragment-Host: org.openhab.core.automation
org.openhab.core.io.console;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)'
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -66,4 +66,6 @@ Fragment-Host: org.openhab.core.automation
org.openhab.core.io.console;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)'
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -63,4 +63,6 @@ Fragment-Host: org.openhab.core.automation.module.script
org.openhab.core.io.console;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)'
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -66,4 +66,6 @@ Fragment-Host: org.openhab.core.automation
org.openhab.core.io.console;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)'
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -66,4 +66,6 @@ Fragment-Host: org.openhab.core.automation
org.openhab.core.io.console;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)'
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -61,4 +61,6 @@ Fragment-Host: org.openhab.core.config.core
org.openhab.core;version='[4.1.0,4.1.1)',\
org.openhab.core.config.core;version='[4.1.0,4.1.1)',\
org.openhab.core.config.core.tests;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)'
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -66,4 +66,6 @@ Fragment-Host: org.openhab.core.config.discovery.mdns
org.openhab.core.io.transport.mdns;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)'
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -65,4 +65,6 @@ Fragment-Host: org.openhab.core.config.discovery
org.openhab.core.io.console;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)'
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -66,4 +66,6 @@ Fragment-Host: org.openhab.core.config.discovery.usbserial.linuxsysfs
org.openhab.core.io.console;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)'
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -74,4 +74,6 @@ Provide-Capability: \
org.openhab.core.io.console;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)'
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -54,4 +54,6 @@ Fragment-Host: org.openhab.core.config.dispatch
org.openhab.core;version='[4.1.0,4.1.1)',\
org.openhab.core.config.dispatch;version='[4.1.0,4.1.1)',\
org.openhab.core.config.dispatch.tests;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)'
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -63,4 +63,6 @@ feature.openhab-config: \
org.openhab.core.config.core;version='[4.1.0,4.1.1)',\
org.openhab.core.ephemeris;version='[4.1.0,4.1.1)',\
org.openhab.core.ephemeris.tests;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)'
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -72,4 +72,6 @@ Fragment-Host: org.openhab.core.io.net
org.openhab.core;version='[4.1.0,4.1.1)',\
org.openhab.core.io.net;version='[4.1.0,4.1.1)',\
org.openhab.core.io.net.tests;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)'
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -106,4 +106,6 @@ Fragment-Host: org.openhab.core.io.rest.core
org.openhab.core.semantics;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)'
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -104,7 +104,6 @@ Fragment-Host: org.openhab.core.model.item
org.openhab.core.model.item.tests;version='[4.1.0,4.1.1)',\
org.openhab.core.model.persistence;version='[4.1.0,4.1.1)',\
org.openhab.core.model.rule;version='[4.1.0,4.1.1)',\
org.openhab.core.model.rule.runtime;version='[4.1.0,4.1.1)',\
org.openhab.core.model.script;version='[4.1.0,4.1.1)',\
org.openhab.core.model.script.runtime;version='[4.1.0,4.1.1)',\
org.openhab.core.model.sitemap;version='[4.1.0,4.1.1)',\
@ -114,4 +113,7 @@ Fragment-Host: org.openhab.core.model.item
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.core.voice;version='[4.1.0,4.1.1)'
org.openhab.core.voice;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.openhab.core.model.thing.runtime;version='[4.1.0,4.1.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -117,4 +117,7 @@ Fragment-Host: org.openhab.core.model.rule.runtime
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.core.voice;version='[4.1.0,4.1.1)'
org.openhab.core.voice;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.openhab.core.model.thing.runtime;version='[4.1.0,4.1.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -110,7 +110,6 @@ Fragment-Host: org.openhab.core.model.script
org.openhab.core.model.item;version='[4.1.0,4.1.1)',\
org.openhab.core.model.persistence;version='[4.1.0,4.1.1)',\
org.openhab.core.model.rule;version='[4.1.0,4.1.1)',\
org.openhab.core.model.rule.runtime;version='[4.1.0,4.1.1)',\
org.openhab.core.model.script;version='[4.1.0,4.1.1)',\
org.openhab.core.model.script.runtime;version='[4.1.0,4.1.1)',\
org.openhab.core.model.script.tests;version='[4.1.0,4.1.1)',\
@ -121,4 +120,6 @@ Fragment-Host: org.openhab.core.model.script
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.core.voice;version='[4.1.0,4.1.1)'
org.openhab.core.voice;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.openhab.core.model.thing.runtime;version='[4.1.0,4.1.1)'

View File

@ -110,7 +110,6 @@ Fragment-Host: org.openhab.core.model.thing
org.openhab.core.model.item.runtime;version='[4.1.0,4.1.1)',\
org.openhab.core.model.persistence;version='[4.1.0,4.1.1)',\
org.openhab.core.model.rule;version='[4.1.0,4.1.1)',\
org.openhab.core.model.rule.runtime;version='[4.1.0,4.1.1)',\
org.openhab.core.model.script;version='[4.1.0,4.1.1)',\
org.openhab.core.model.script.runtime;version='[4.1.0,4.1.1)',\
org.openhab.core.model.sitemap;version='[4.1.0,4.1.1)',\
@ -123,4 +122,6 @@ Fragment-Host: org.openhab.core.model.thing
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.core.voice;version='[4.1.0,4.1.1)'
org.openhab.core.voice;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -59,4 +59,6 @@ Fragment-Host: org.openhab.core.storage.json
org.openhab.core.storage.json.tests;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)'
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -58,4 +58,6 @@ Fragment-Host: org.openhab.core
org.objenesis;version='[3.3.0,3.3.1)',\
org.openhab.core;version='[4.1.0,4.1.1)',\
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.tests;version='[4.1.0,4.1.1)'
org.openhab.core.tests;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)'

View File

@ -67,4 +67,5 @@ Fragment-Host: org.openhab.core.thing
org.openhab.core.test;version='[4.1.0,4.1.1)',\
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.thing.tests;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)'
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)'

View File

@ -72,4 +72,5 @@ Fragment-Host: org.openhab.core.voice
org.openhab.core.thing;version='[4.1.0,4.1.1)',\
org.openhab.core.transform;version='[4.1.0,4.1.1)',\
org.openhab.core.voice;version='[4.1.0,4.1.1)',\
org.openhab.core.voice.tests;version='[4.1.0,4.1.1)'
org.openhab.core.voice.tests;version='[4.1.0,4.1.1)',\
org.openhab.base-fixes;version='[1.0.0,1.0.1)'