dotnet / dotnet/orleans

Why not use Response.Dispose?

Open
#9,803 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
10.9k
Forks
2.1k
Avg merge
13h 56m
Merged PRs (30d)
351

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at SafeSendResponse and trace how Response is created by ResponsePool, copied, sent, and returned through Dispose(). Check the surrounding response-lifetime handling before deciding whether disposal is required; done means the ownership decision is validated and covered by an appropriate test or documented rationale.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.