You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seq event streaming from readme deadlocks when disposing the stream when the seq instance is restarted.
I am attempting to stream seq events for additional processing. I was testing how it handles the scenario where the seq instance is restarted, and it appears to deadlock when disposing of the stream.
varseqUrl="http://localhost:5341";Log.Logger=newLoggerConfiguration().WriteTo.Seq(seqUrl).WriteTo.Console().CreateLogger();varfilter="@Level = 'Error'";varconnection=newSeqConnection(seqUrl);while(true){awaitconnection.EnsureConnectedAsync(TimeSpan.FromSeconds(15));varstream=awaitconnection.Events.StreamAsync<JObject>(filter:filter);varsubscription=stream.Subscribe(
log =>Log.Information("OnNext"),
ex =>Log.Information("OnError"),()=>Log.Information("OnCompleted"));awaitTask.Delay(1000);Log.Error("logging fake error to test seq streaming");awaitstream;subscription.Dispose();stream.Dispose();// <-- stuck hereLog.Information("loop end");}
It seems to get stuck while waiting for _run task to finish here:
Thanks for the report @akilin. If you're attempting to hang-up from the client-side of the stream we shouldn't block. Since the websocket is closed by the server on restart I would've expected it to throw, but we'll investigate and see what's going on there.
Seq event streaming from readme deadlocks when disposing the stream when the seq instance is restarted.
I am attempting to stream seq events for additional processing. I was testing how it handles the scenario where the seq instance is restarted, and it appears to deadlock when disposing of the stream.
It seems to get stuck while waiting for
_run
task to finish here:seq-api/src/Seq.Api/Streams/ObservableStream.cs
Line 220 in 4c650b2
Repo with reproduction: https://github.com/akilin/demos/tree/master/seq-stream
Steps to reproduce:
seq-stream
folderOnNext
in the console logsThe text was updated successfully, but these errors were encountered: