Skip to content

Commit 85c577d

Browse files
Fix issues with subscription cleanup (#8763)
1 parent c6c491c commit 85c577d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/HotChocolate/Core/src/Execution/Processing/SubscriptionExecutor.Subscription.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,16 @@ public async ValueTask DisposeAsync()
123123
{
124124
if (!_disposed)
125125
{
126-
await _sourceStream.DisposeAsync().ConfigureAwait(false);
126+
try
127+
{
128+
await _sourceStream.DisposeAsync().ConfigureAwait(false);
129+
}
130+
catch
131+
{
132+
// We ignore any errors during disposal, so we can still
133+
// gracefully dispose the subscription scope.
134+
}
135+
127136
_subscriptionScope?.Dispose();
128137
_disposed = true;
129138
}

src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Execution/Nodes/OperationExecutionNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public async ValueTask<bool> MoveNextAsync()
414414

415415
public async ValueTask DisposeAsync()
416416
{
417-
if (!_disposed)
417+
if (_disposed)
418418
{
419419
return;
420420
}

0 commit comments

Comments
 (0)