Skip to content

Guard semaphore release with try/finally in TestMcpStorage#9390

Merged
glen-84 merged 1 commit intomainfrom
gai/guard-semaphore-release
Mar 18, 2026
Merged

Guard semaphore release with try/finally in TestMcpStorage#9390
glen-84 merged 1 commit intomainfrom
gai/guard-semaphore-release

Conversation

@glen-84
Copy link
Member

@glen-84 glen-84 commented Mar 18, 2026

Summary of the changes (Less than 80 chars)

  • Guard semaphore release with try/finally in TestMcpStorage.

Copilot AI review requested due to automatic review settings March 18, 2026 10:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the in-memory TestMcpStorage test implementation by ensuring semaphore releases always occur, even when dictionary updates throw, aligning the write paths with the existing read paths’ try/finally pattern.

Changes:

  • Wrap _promptSemaphore.Release() in try/finally in AddOrUpdatePromptAsync.
  • Wrap _toolSemaphore.Release() in try/finally in AddOrUpdateToolAsync.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@glen-84 glen-84 merged commit cf775c2 into main Mar 18, 2026
127 checks passed
@glen-84 glen-84 deleted the gai/guard-semaphore-release branch March 18, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants