This commit is contained in:
Jacek Sieka 2020-08-06 20:14:40 +02:00 committed by GitHub
parent c6c0c152c0
commit 7c2ab38da1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -79,7 +79,7 @@ method init*(s: Secure) {.gcsafe.} =
except CancelledError as exc:
warn "securing connection canceled"
await conn.close()
raise
raise exc
except CatchableError as exc:
warn "securing connection failed", msg = exc.msg
await conn.close()

View File

@ -306,6 +306,6 @@ method close*(s: BufferStream) {.async, gcsafe.} =
else:
trace "attempt to close an already closed bufferstream", trace = getStackTrace()
except CancelledError as exc:
raise
raise exc
except CatchableError as exc:
trace "error closing buffer stream", exc = exc.msg

View File

@ -68,7 +68,7 @@ type
streamHandler*: StreamHandler
secureManagers*: seq[Secure]
pubSub*: Option[PubSub]
dialLock: Table[string, AsyncLock]
dialLock: Table[PeerID, AsyncLock]
hooks: Table[Lifecycle, HashSet[Hook]]
pubsubMonitors: Table[PeerId, Future[void]]
@ -291,7 +291,7 @@ proc internalConnect(s: Switch,
return conn
let lock = s.dialLock.mgetOrPut($peerId, newAsyncLock())
let lock = s.dialLock.mgetOrPut(peerId, newAsyncLock())
try:
await lock.acquire()
@ -315,7 +315,7 @@ proc internalConnect(s: Switch,
libp2p_dialed_peers.inc()
except CancelledError as exc:
trace "dialing canceled", exc = exc.msg, peer = peerId
raise
raise exc
except CatchableError as exc:
trace "dialing failed", exc = exc.msg, peer = peerId
libp2p_failed_dials.inc()