Skip to content

Commit 580b419

Browse files
authored
Merge pull request #103 from pavelhoral/upgrade-rxjava
Upgrade rxjava and fix connection handler startup wait
2 parents c9a7427 + 3fb8c57 commit 580b419

File tree

4 files changed

+29
-14
lines changed

4 files changed

+29
-14
lines changed

opendj-core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@
5252
<dependency>
5353
<groupId>org.reactivestreams</groupId>
5454
<artifactId>reactive-streams</artifactId>
55-
<version>1.0.0</version>
55+
<version>1.0.3</version>
5656
</dependency>
5757

5858
<dependency>
5959
<groupId>io.reactivex.rxjava2</groupId>
6060
<artifactId>rxjava</artifactId>
61-
<version>2.0.0</version>
61+
<version>2.2.21</version>
6262
</dependency>
6363

6464
<dependency>

opendj-server-legacy/src/main/java/org/forgerock/opendj/reactive/LDAPConnectionHandler2.java

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*
1414
* Copyright 2006-2010 Sun Microsystems, Inc.
1515
* Portions Copyright 2011-2016 ForgeRock AS.
16+
* Portions Copyright 2026 Wren Security
1617
*/
1718
package org.forgerock.opendj.reactive;
1819

@@ -673,6 +674,22 @@ public Stream<Response> handle(final LDAPClientContext context,
673674
logger.info(NOTE_CONNHANDLER_STARTED_LISTENING, handlerName);
674675
}
675676

677+
@Override
678+
public void start() {
679+
// The Directory Server start process should only return when the connection
680+
// handlers port are fully opened and working. The start method therefore needs
681+
// to wait for the created thread to actually start accepting connections
682+
synchronized (waitListen) {
683+
super.start();
684+
685+
try {
686+
waitListen.wait();
687+
} catch (InterruptedException e) {
688+
// If something interrupted the start its probably better to return ASAP.
689+
}
690+
}
691+
}
692+
676693
/**
677694
* Operates in a loop, accepting new connections and ensuring that requests on those connections are handled
678695
* properly.
@@ -711,16 +728,16 @@ public void run() {
711728
}
712729

713730
try {
731+
// If we have gotten here, then we are about to start listening
732+
// for the first time since startup or since we were previously disabled.
733+
startListener();
734+
lastIterationFailed = false;
735+
714736
// At this point, the connection Handler either started correctly or failed
715737
// to start but the start process should be notified and resume its work in any cases.
716738
synchronized (waitListen) {
717739
waitListen.notify();
718740
}
719-
720-
// If we have gotten here, then we are about to start listening
721-
// for the first time since startup or since we were previously disabled.
722-
startListener();
723-
lastIterationFailed = false;
724741
} catch (Exception e) {
725742
// Clean up the messed up HTTP server
726743
stopListener();

opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPConnectionHandler.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -804,10 +804,9 @@ public void processServerShutdown(LocalizableMessage reason)
804804
@Override
805805
public void start()
806806
{
807-
// The Directory Server start process should only return
808-
// when the connection handlers port are fully opened
809-
// and working. The start method therefore needs to wait for
810-
// the created thread to
807+
// The Directory Server start process should only return when the connection
808+
// handlers port are fully opened and working. The start method therefore needs
809+
// to wait for the created thread to actually start accepting connections
811810
synchronized (waitListen)
812811
{
813812
super.start();
@@ -818,8 +817,7 @@ public void start()
818817
}
819818
catch (InterruptedException e)
820819
{
821-
// If something interrupted the start its probably better
822-
// to return ASAP.
820+
// If something interrupted the start its probably better to return ASAP.
823821
}
824822
}
825823
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
</repositories>
9292

9393
<properties>
94-
<pgpVerifyKeysVersion>1.9.3</pgpVerifyKeysVersion>
94+
<pgpVerifyKeysVersion>1.9.7</pgpVerifyKeysVersion>
9595

9696
<product.name>Wren:DS</product.name>
9797
<product.name.lowercase>wrends</product.name.lowercase>

0 commit comments

Comments
 (0)