|
18 | 18 | package bisq.network.p2p.node;
|
19 | 19 |
|
20 | 20 |
|
| 21 | +import bisq.common.network.Address; |
| 22 | +import bisq.common.network.TransportConfig; |
| 23 | +import bisq.common.network.TransportType; |
21 | 24 | import bisq.common.observable.Observable;
|
22 | 25 | import bisq.common.threading.ThreadName;
|
23 | 26 | import bisq.common.timer.Scheduler;
|
24 | 27 | import bisq.common.util.CompletableFutureUtils;
|
25 | 28 | import bisq.common.util.ExceptionUtil;
|
26 | 29 | import bisq.common.util.StringUtils;
|
27 | 30 | import bisq.network.NetworkService;
|
28 |
| -import bisq.common.network.Address; |
29 |
| -import bisq.common.network.TransportConfig; |
30 |
| -import bisq.common.network.TransportType; |
31 | 31 | import bisq.network.identity.NetworkId;
|
32 | 32 | import bisq.network.p2p.message.EnvelopePayloadMessage;
|
33 | 33 | import bisq.network.p2p.node.authorization.AuthorizationService;
|
@@ -201,9 +201,9 @@ public void initialize() {
|
201 | 201 | if (startingStateLatch.isPresent() && startingStateLatch.get().getCount() > 0) {
|
202 | 202 | try {
|
203 | 203 | log.info("Our node is still starting up. We block the calling thread until state is RUNNING or a throw and exception after a timeout. Node: {}", getNodeInfo());
|
204 |
| - boolean success = startingStateLatch.get().await(120, TimeUnit.SECONDS); //hsUploadTimeout |
| 204 | + boolean success = startingStateLatch.get().await(120, TimeUnit.SECONDS); |
205 | 205 | if (!success) {
|
206 |
| - String errorMessage = "State did not change from STARTING to RUNNING in 120 sec. Node: " + getNodeInfo(); |
| 206 | + String errorMessage = "We got called a repeated initialize. State has not change from STARTING to RUNNING in 120 sec. Node: " + getNodeInfo(); |
207 | 207 | log.warn(errorMessage);
|
208 | 208 | throw new RuntimeException(new TimeoutException(errorMessage));
|
209 | 209 | } else {
|
@@ -554,14 +554,11 @@ public void handleNetworkMessage(EnvelopePayloadMessage envelopePayloadMessage,
|
554 | 554 | if (findConnection(connection).isEmpty()) {
|
555 | 555 | // TODO for now we delay the shutdown call to not introduce a bigger change in behaviour.
|
556 | 556 | // We need to test more to see if that case happens and why, and if there might be valid listeners.
|
557 |
| - log.warn(""" |
558 |
| - We got handleNetworkMessage called from an orphaned connection which is not managed by our \ |
559 |
| - outboundConnectionsByAddress or inboundConnectionsByAddress maps. \ |
560 |
| - We close after a short delay that connection to avoid memory leaks. \ |
561 |
| - We still notify listeners as its is unclear yet if there are valid listeners in that case.\ |
562 |
| - |
563 |
| - envelopePayloadMessage={} |
564 |
| - connection={}""", |
| 557 | + log.warn("We got handleNetworkMessage called from an orphaned connection which is not managed by our\n" + |
| 558 | + "outboundConnectionsByAddress or inboundConnectionsByAddress maps.\n" + |
| 559 | + "We close after a short delay that connection to avoid memory leaks.\n" + |
| 560 | + "We still notify listeners as its is unclear yet if there are valid listeners in that case.\n" + |
| 561 | + "envelopePayloadMessage={} connection={}", |
565 | 562 | StringUtils.truncate(envelopePayloadMessage), connection);
|
566 | 563 | Scheduler.run(() -> connection.shutdown(CloseReason.ORPHANED_CONNECTION))
|
567 | 564 | .host(this)
|
|
0 commit comments