Skip to content
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

Starvation thread pool when working with the rabbitmq #22

Open
oleg-peresada opened this issue Sep 6, 2020 · 0 comments
Open

Starvation thread pool when working with the rabbitmq #22

oleg-peresada opened this issue Sep 6, 2020 · 0 comments

Comments

@oleg-peresada
Copy link

When called IMessagingComponentFactory with SendMessageAsync
A call was made inside the library ViennaNET

public async Task SendAsync(
BaseMessage message,
IReadOnlyDictionary<string, object> additionalProperties = null,
CancellationToken cancellationToken = default (CancellationToken)) => await Task.Factory.StartNew((Func) (() => this.SendMessage(message, additionalProperties)), cancellationToken);

which calls the method in the inside EeasyMQ

public void Publish(
IExchange exchange,
string routingKey,
bool mandatory,
MessageProperties messageProperties,
byte[] body)

which makes this call

public T Invoke(Func<IModel, T> channelAction) => this.InvokeAsync(channelAction).GetAwaiter().GetResult();

All this leads to the following result and suspending working the app:

image

image

Currently there is no way to call pure async method (PublishAsync) from the ViennaNET, what leads to starvation thread pool.
(https://docs.microsoft.com/en-us/archive/blogs/vancem/diagnosing-net-core-threadpool-starvation-with-perfview-why-my-service-is-not-saturating-all-cores-or-seems-to-stall)

Quote from the documentation:
With publisher confirms on the synchronous publish method will slow down significantly. If performance is a concern, you should consider using the PublishAsync method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants