Skip to content

Commit

Permalink
JGRP-2805 GossipRouter NPE on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanemerson committed Jun 13, 2024
1 parent a14ec07 commit 17ba4df
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 @@ -221,6 +216,13 @@ public GossipRouter start() throws Exception {
server.receiver(this).setMaxLength(max_length)
.addConnectionListener(this)
.connExpireTimeout(expiry_time).reaperInterval(reaper_interval).linger(linger_timeout);

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

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

0 comments on commit 17ba4df

Please sign in to comment.