Skip to content

Commit

Permalink
Merge pull request #155 from cnblogs/add-missing-SemaphoreSlim.Release
Browse files Browse the repository at this point in the history
Add missing SemaphoreSlim.Release
  • Loading branch information
cnblogs-dudu authored Dec 2, 2020
2 parents 3b8eaea + 7e4b1c7 commit 778914b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Enyim.Caching/Memcached/MemcachedNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ public IPooledSocketResult Acquire()
// maybe we died while waiting
if (!this.isAlive)
{
_semaphore.Release();

message = "Pool is dead, returning null. " + _endPoint;
if (_isDebugEnabled) _logger.LogDebug(message);
result.Fail(message);
Expand Down Expand Up @@ -474,6 +476,8 @@ public IPooledSocketResult Acquire()
_logger.LogError(message, e);

this.MarkAsDead();
_semaphore.Release();

result.Fail(message, e);
return result;
}
Expand Down

0 comments on commit 778914b

Please sign in to comment.