Skip to content

Commit

Permalink
Network: catch CircuitDestroyedException
Browse files Browse the repository at this point in the history
This error is not catched because of removing generic try-with
and causes a red CI. In this commit we catch this error and
kill child circuits.

```
Unexpected exception happened in the retry loop, ex = System.AggregateException: One or more errors occurred. (Circuit got destroyed, reason ChannelClosed)
 ---> NOnion.CircuitDestroyedException: Circuit got destroyed, reason ChannelClosed
   --- End of inner exception stack trace ---
The active test run was aborted. Reason: Test host process crashed : Unhandled exception. System.AggregateException: One or more errors occurred. (Circuit got destroyed, reason ChannelClosed)
 ---> NOnion.CircuitDestroyedException: Circuit got destroyed, reason ChannelClosed
   --- End of inner exception stack trace ---
   at Microsoft.FSharp.Control.AsyncPrimitives.Start@907-1.Invoke(ExceptionDispatchInfo edi) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 907
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 109
   at <StartupCode$FSharp-Core>.$Async.-ctor@163-1.Invoke(Object o) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 165
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
```
  • Loading branch information
parhamsaremi committed Nov 23, 2022
1 parent 186e075 commit f38390e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NOnion/Network/TorGuard.fs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ type TorGuard private (client: TcpClient, sslStream: SslStream) =
self.HandleIncomingCellException<CircuitDecryptionFailedException>
cell
ex
| :? CircuitDestroyedException as ex ->
self.HandleIncomingCellException<CircuitDestroyedException>
cell
ex
| ex -> return raise <| FSharpUtil.ReRaise ex
| None ->
self.KillChildCircuits()
Expand Down

0 comments on commit f38390e

Please sign in to comment.