Queuing Problems for Asynchronous Controllers

Asked

Viewed 52 times

0

Hello,

I’m having some problems regarding the Asynchronous Controllers, because the queuing of requisitions server keeps being locked to the client during some operation. The routines work exactly, I can perform even parallel functions (for example, I can play 4 parallel searches and wait them using (await Task.Whenall(tasks);), but if the operation takes too long and I try to access some other page (some that has the asynchronous Controller), continues blocking and only releases the page when the operation ends.

An example: the site has a kind of product search, I did this asynchronous routine, because if it takes long the user can enter another page without blocking problem. There was able to go to other pages without blocking during the search, until one day began to block the queuing, when this occurred I found it strange and as I was in local environment, I decided to restart the application, erasing the cache and history (believing that something related to this could be affecting). After starting the application again, there was no lock during the search and everything was working in conceptual mode.

However, today the same problem happened and now in production environment. I don’t know if it could be some problem regarding threads or with the server itself. I had problems with locks on controllers that used sessions, but in a topical explained to me that if there is Session there is a security lock.

I don’t know if this can be related to some configuration in the application pool (IIS) or if it is normal since I started using asynchronous techniques recently. If you can enlighten me,.

  • You use .ConfigureAwait(false) after calling asynchronous methods?

1 answer

0

If you want to release the resources even without them being 100% executed, just change

await Task.WhenAll(tasks);

for

await Task.WhaitAll(tasks);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.