8000 Fix GetValueAsync concurrent issue by ZeekoZhu · Pull Request #104 · cnblogs/EnyimMemcachedCore · GitHub
[go: up one dir, main page]

Skip to content

Fix GetValueAsync concurrent issue #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ZeekoZhu
Copy link

Use SemaphoreSlim to control acquisition of PooledSocket in ExecuteOperationAsync, this can prevent long time blocking when it under high concurrency.

@cnblogs-dudu cnblogs-dudu self-requested a review May 1, 2019 02:27
8000
Copy link
@cnblogs-dudu cnblogs-dudu left a comment

Choose a reason for hiding this comment

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

SemaphoreSlim.Release should be put in finally

this.internalPoolImpl.InitPool();
this.isInitialized = true;
_logger.LogInformation("MemcachedInitPool-cost: {0}ms", (DateTime.Now - startTime).TotalMilliseconds);
poolInitSemaphore.Release();

Choose a reason for hiding this comment

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

Should put in finally

ZeekoZhu added a commit to ZeekoZhu/EnyimMemcachedCore that referenced this pull request May 4, 2019
@cnblogs-dudu
Copy link

Great! Using SemaphoreSlim.WaitAsync can fix #98 and #99. I will make some tweaks to this PR.

@cnblogs-dudu cnblogs-dudu changed the base branch from master to release/2.2 May 6, 2019 08:11
@cnblogs-dudu cnblogs-dudu force-pushed the fix/get-value-async-blocking branch from b76e82d to 751bd91 Compare May 6, 2019 08:14
@cnblogs-dudu cnblogs-dudu force-pushed the fix/get-value-async-blocking branch from fcd602b to 80e479f Compare May 6, 2019 10:24
@cnblogs-dudu cnblogs-dudu merged commit b6111ed into cnblogs:release/2.2 May 6, 2019
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.

2 participants
0