Asynchronous method blocking Queue

1

I'm using MVC and then I've addressed asynchronous methods for Actions in Controllers in order not to block access to other pages of the site while a long-running process is taking place.

However, I have had problems in the following scenario:

The long-term process is a finalization of Reserve and goes through several processes. In this way, I created the following Action (which is called through a POST via AJAX ):

[HttpPost]
public async Task<ActionResult> Finalizar(bool? isMultiple)
{
    //obtendo os dados finais armazenados num tempdata
    var reserva = (ReservaViewModel)TempData["Reserva"];

    //chamada do metodo assincrono
    var result = await _reservaAsyncAppService.FinalizarReserva(reserva);

    //restando do codigo...
}

I have the following Action that is the Home >

public async Task<ActionResult> Index()
{
    ViewBag.Portfolio = await _programaAppService.ListarPortfolioAsync();

    return View();
}

Doubt: When I start the Finalization of the Reserve, in another tab I try to access the Home of the site, however, it will be reading for a few seconds and when the Booking process is finished it will open Home. p>

I wanted to know why this is happening, I am using asynchronous methods in both Actions, I do not think it should have this type of block in the request queue.

I noticed that when you start finalizing the reservation and during the process in another browser accessing Home it normally opens, without queue blocking, but when starting the process of finalizing the reservation and trying to open the Home in another tab of the same browser the locking happens. Is this normal?

If you can help me, thank you.

    
asked by anonymous 06.05.2017 / 05:32

1 answer

1

Because ASP.NET MVC queues requests from a single client to avoid causing session variable conflicts .

As the article explains, it is possible to implement a SessionStateStoreProvider that does not block other requests, but I do not know how much this is worth for your case.

    
09.05.2017 / 20:03