orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Why not use Response.Dispose?

Open jerviscui opened this issue 1 month ago • 2 comments

Response<TResult> is created by ResponsePool, and returns to the pool with the Dispose() method.

Why wasn't Dispose() called in SafeSendResponse?

private void SafeSendResponse(Message message, Response response)
{
    try
    {
        SendResponse(message, (Response)this._deepCopier.Copy(response));
    }
    catch (Exception exc)
    {
        LogWarningResponseFailed(this.logger, exc);
        SendResponse(message, Response.FromException(exc));
    }

    //perhaps finally
    final{
      response.Dispose();
    }
}
```Dispose

jerviscui avatar Nov 23 '25 15:11 jerviscui

SafeSendResponse is not the owner of the response, it's not their responsibility to dispose it.

ikkentim avatar Nov 24 '25 12:11 ikkentim

SafeSendResponse is not the owner of the response, it's not their responsibility to dispose it.

Okay, but there's nowhere to call Response<TResult>.Dispose().

jerviscui avatar Dec 01 '25 08:12 jerviscui