Skip to content

Close unclosed resources in the whole project#267

Merged
dsp-ant merged 13 commits intomodelcontextprotocol:mainfrom
Kludex:close-resources
Mar 13, 2025
Merged

Close unclosed resources in the whole project#267
dsp-ant merged 13 commits intomodelcontextprotocol:mainfrom
Kludex:close-resources

Conversation

@Kludex
Copy link
Copy Markdown
Member

@Kludex Kludex commented Mar 12, 2025

I'll be using this branch on PydanticAI. I can't add tests otherwise.

@Kludex Kludex changed the title Close resources Close streams in send_request Mar 12, 2025
Copy link
Copy Markdown
Member

@jerome3o-anthropic jerome3o-anthropic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thank you

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we'd also like to delete the entry in self._response_streams also

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional - I can get this later if needed

@jerome3o-anthropic
Copy link
Copy Markdown
Member

Looks like there are a bunch of check failures. I'm not sure if these are even related though

@Kludex
Copy link
Copy Markdown
Member Author

Kludex commented Mar 12, 2025

I think it's from a change that I made yesterday, but unrelated to this PR. I think it was merged before the pipeline run? 🤔

@dsp-ant
Copy link
Copy Markdown
Member

dsp-ant commented Mar 12, 2025

This leaves one pytest error which might be legit

venvPath = "."
venv = ".venv"
strict = [
"src/mcp/server/fastmcp/tools/base.py",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More should be added here.

@Kludex Kludex changed the title Close streams in send_request Close unclosed resources in the whole project Mar 13, 2025
@dsp-ant dsp-ant self-requested a review March 13, 2025 10:57
@dsp-ant dsp-ant merged commit 94d326d into modelcontextprotocol:main Mar 13, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants