fix-deadlock
This commit is contained in:
parent
3061d98417
commit
644e291356
26
0013-fix-deadlock.patch
Normal file
26
0013-fix-deadlock.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
diff --git a/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKSessionWatcher.java b/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKSessionWatcher.java
|
||||||
|
index a350d4a5b3..ed6870824b 100644
|
||||||
|
--- a/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKSessionWatcher.java
|
||||||
|
+++ b/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKSessionWatcher.java
|
||||||
|
@@ -80,7 +80,11 @@ public class ZKSessionWatcher implements AutoCloseable, Watcher {
|
||||||
|
}
|
||||||
|
|
||||||
|
// task that runs every TICK_TIME to check zk connection
|
||||||
|
- private synchronized void checkConnectionStatus() {
|
||||||
|
+ // NOT ThreadSafe:
|
||||||
|
+ // If zk client can't ensure the order, it may lead to problems.
|
||||||
|
+ // Currently,we only use it in single thread, it will be fine. but we shouldn't leave any potential problems
|
||||||
|
+ // in the future.
|
||||||
|
+ private void checkConnectionStatus() {
|
||||||
|
try {
|
||||||
|
CompletableFuture<Watcher.Event.KeeperState> future = new CompletableFuture<>();
|
||||||
|
zk.exists("/", false, (StatCallback) (rc, path, ctx, stat) -> {
|
||||||
|
@@ -125,7 +129,7 @@ public class ZKSessionWatcher implements AutoCloseable, Watcher {
|
||||||
|
currentStatus = SessionEvent.SessionLost;
|
||||||
|
}
|
||||||
|
|
||||||
|
- private void checkState(Watcher.Event.KeeperState zkClientState) {
|
||||||
|
+ private synchronized void checkState(Watcher.Event.KeeperState zkClientState) {
|
||||||
|
switch (zkClientState) {
|
||||||
|
case Expired:
|
||||||
|
if (currentStatus != SessionEvent.SessionLost) {
|
||||||
@ -1,6 +1,6 @@
|
|||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
%define pulsar_ver 2.10.4
|
%define pulsar_ver 2.10.4
|
||||||
%define pkg_ver 12
|
%define pkg_ver 13
|
||||||
%define _prefix /opt/pulsar
|
%define _prefix /opt/pulsar
|
||||||
Summary: Cloud-Native, Distributed Messaging and Streaming
|
Summary: Cloud-Native, Distributed Messaging and Streaming
|
||||||
Name: pulsar
|
Name: pulsar
|
||||||
@ -22,6 +22,7 @@ Patch0009: 0009-CVE-2022-24329.patch
|
|||||||
Patch0010: 0010-CVE-2022-22970.patch
|
Patch0010: 0010-CVE-2022-22970.patch
|
||||||
Patch0011: 0011-CVE-2023-25194.patch
|
Patch0011: 0011-CVE-2023-25194.patch
|
||||||
Patch0012: 0012-CVE-2023-2976.patch
|
Patch0012: 0012-CVE-2023-2976.patch
|
||||||
|
Patch0013: 0013-fix-deadlock.patch
|
||||||
BuildRoot: /root/rpmbuild/BUILDROOT/
|
BuildRoot: /root/rpmbuild/BUILDROOT/
|
||||||
BuildRequires: java-1.8.0-openjdk-devel,maven,systemd
|
BuildRequires: java-1.8.0-openjdk-devel,maven,systemd
|
||||||
Requires: java-1.8.0-openjdk,systemd
|
Requires: java-1.8.0-openjdk,systemd
|
||||||
@ -46,6 +47,7 @@ Pulsar is a distributed pub-sub messaging platform with a very flexible messagin
|
|||||||
%patch0010 -p1
|
%patch0010 -p1
|
||||||
%patch0011 -p1
|
%patch0011 -p1
|
||||||
%patch0012 -p1
|
%patch0012 -p1
|
||||||
|
%patch0013 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
mvn clean install -Pcore-modules,-main -DskipTests
|
mvn clean install -Pcore-modules,-main -DskipTests
|
||||||
@ -71,6 +73,8 @@ getent passwd pulsar >/dev/null || useradd -r -g pulsar -d / -s /sbin/nologin pu
|
|||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Dec 7 2023 Dapeng Sun <sundapeng@cmss.chinamobile.com> - 2.10.4-13
|
||||||
|
- resolve fix deadlock
|
||||||
* Thu Dec 7 2023 Dapeng Sun <sundapeng@cmss.chinamobile.com> - 2.10.4-12
|
* Thu Dec 7 2023 Dapeng Sun <sundapeng@cmss.chinamobile.com> - 2.10.4-12
|
||||||
- resolve cve-2023-2976
|
- resolve cve-2023-2976
|
||||||
* Wed Dec 6 2023 Dapeng Sun <sundapeng@cmss.chinamobile.com> - 2.10.4-11
|
* Wed Dec 6 2023 Dapeng Sun <sundapeng@cmss.chinamobile.com> - 2.10.4-11
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user