Skip to content

Commit

Permalink
JGRP-2805 GossipRouter NPE on startup (#802)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanemerson authored Jun 13, 2024
1 parent a14ec07 commit 9790cb2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/org/jgroups/stack/GossipRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,6 @@ public GossipRouter start() throws Exception {
if(jmx)
JmxConfigurator.register(this, Util.getMBeanServer(), "jgroups:name=GossipRouter");

if(diag.isEnabled()) {
StackType ip_version=bind_addr instanceof Inet6Address? StackType.IPv6 : StackType.IPv4;
Configurator.setDefaultAddressValues(diag, ip_version);
diag.start();
}
// Creating the DiagnosticsHandler _before_ the TLS socket factory makes the former use regular sockets;
// if this was not the case, Probe would have to be extended to use SSLSockets, too
if(tls.enabled()) {
Expand All @@ -222,6 +217,13 @@ public GossipRouter start() throws Exception {
.addConnectionListener(this)
.connExpireTimeout(expiry_time).reaperInterval(reaper_interval).linger(linger_timeout);
server.start();

if(diag.isEnabled()) {
StackType ip_version=bind_addr instanceof Inet6Address? StackType.IPv6 : StackType.IPv4;
Configurator.setDefaultAddressValues(diag, ip_version);
diag.start();
}

Runtime.getRuntime().addShutdownHook(new Thread(GossipRouter.this::stop));
return this;
}
Expand Down

0 comments on commit 9790cb2

Please sign in to comment.