Open cheatfate opened 10 months ago
@cheatfate I don't think I follow what you meant. The links you sent don't match with what you mention (I believe). There is a TransportUseClosedError
handled (and re-reased) nearby, but none of those links points to it.
One of them points to this piece of code in the same function as the aforementioned except TransportUseClosedError
:
except HttpError as exc:
debug "Http Error", exc = exc.msg
except AsyncStreamError as exc:
And the other points to the parameters of the next function, which seems to be unrelated to any TransportUseClosedError
:
hostname: string,
address: MultiAddress,
peerId: Opt[PeerId] = Opt.none(PeerId)): Future[Connection] {.async.} =
Do you mean that the "normal shutdown process" somehow triggers the except CatchableError
line in the accept
proc in switch.nim
?
Everything what falls into
error "Exception in accept loop, exiting", exc = exc.msg
looks like serious error, and nimbus
consumers actually asking what the error is. But this error happens when TransportUseClosedError
happens and got catched by this handler. This specific exception MUST not be reported as error
type of logs.
Please, next time it'd be great to have what the expected behavior should be when describing the issue.
@cheatfate do you have more logs related to it? The error msg "Transport closed, no more connections!" is created by https://github.com/vacp2p/nim-libp2p/blob/c5db35d9b006b597886440293ff5cbd86162452c/libp2p/transports/transport.nim#L38 and can also happen at https://github.com/vacp2p/nim-libp2p/blob/9059a8aced87741de98813bfe0ef2ed63e0217ab/libp2p/transports/tcptransport.nim#L204.
Was there a log "Server was closed" before the one you reported? If it was indeed caused by TransportUseClosedError
, there should be one https://github.com/vacp2p/nim-libp2p/blob/9059a8aced87741de98813bfe0ef2ed63e0217ab/libp2p/transports/tcptransport.nim#L234.
This error statement has been shown on normal shutdown process:
It happens because of this handler https://github.com/status-im/nim-libp2p/blob/e3c967ad1939fb33b8e13759037d193734acd202/libp2p/switch.nim#L276 which do not knows anything about
TransportUseClosedError
which can be raised https://github.com/status-im/nim-libp2p/blob/unstable/libp2p/transports/tcptransport.nim#L247-L249 and https://github.com/status-im/nim-libp2p/blob/unstable/libp2p/transports/wstransport.nim#L283-L285