Wisej WebSocketException

0
0

Hi all,
we are facing some issue on production server.

The problem is completely random, i post here the stack trace from windows event viewer:

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 14/06/2019 12:04:29
Event time (UTC): 14/06/2019 10:04:29
Event ID: 0ffeb1859a53477d8e64701787f0dcac
Event sequence: 131
Event occurrence: 1
Event detail code: 0

Process information:
Process ID: 5932
Process name: w3wp.exe
Account name: VPS280602\IWPD_34(cristalloGD)

Exception information:
Exception type: WebSocketException
Exception message: Operazione di I/O terminata a causa dell’uscita dal thread oppure della richiesta di un’applicazione
in System.Web.WebSockets.WebSocketPipe.c__DisplayClass9_0.b__0(Int32 hrError, Int32 cbIO, Boolean fUtf8Encoded, Boolean fFinalFragment, Boolean fClose)
— Fine traccia dello stack da posizione precedente dove è stata generata l’eccezione —
in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
in System.Web.WebSockets.AspNetWebSocket.d__45`1.MoveNext()
— Fine traccia dello stack da posizione precedente dove è stata generata l’eccezione —
in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
in System.Web.WebSockets.AspNetWebSocket.c__DisplayClass36_0.<b__0>d.MoveNext()
— Fine traccia dello stack da posizione precedente dove è stata generata l’eccezione —
in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
in System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
in Wisej.Core.HttpHandler.d__18.MoveNext()
— Fine traccia dello stack da posizione precedente dove è stata generata l’eccezione —
in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
in System.Web.WebSocketPipeline.d__9.MoveNext()

We issue it also on test, also random. Attached image with the error.

Wisej 2.0.28
FontAwesome.dll 2.0.0.0
Brotli.dll 2.0.0.0
FullCalendar 2.0.0.0

Any ideas ?
Thanks

Attachment
  • You must to post comments
0
0

Hi Luca,
thanks for your feedback, we roolback our changes.

You say :

When you close the browser or tab, Wisej will stop sending the keep alive “pings” and when the session will expire you will get the page and all other controls disposed.

At the very begging we set sessions unlimited because client doesn’t want the “Expiry session message”.

Default.json OLD


"loaderTimeout": 1000,
"sessionTimeout": 0,
"keepAliveInterval": 15,
"enableWebSocket": true

Default.json NEW


"loaderTimeout": 1000,
"sessionTimeout": 60,
"keepAliveInterval": 15,
"enableWebSocket": true

Now we tested that session are disposed and also components. We manage Application_SessionTimeout to keep session alive on some conditions.

  • You must to post comments
0
0

Closing the browser or closing the tab is the same as hitting refresh or editing the URL. Calling a web method or any ajax request in window.onbeforeunload may fail randomly because the browser will simply close the communication and it may close it while communicating. Synchronous (blocking) ajax calls have been deprecated long ago in all browsers and all Wisej requests are async. There is no way in any browser to differentiate between closing and refreshing.

When you close the browser or tab, Wisej will stop sending the keep alive “pings” and when the session will expire you will get the page and all other controls disposed.

If all your users got kicked out I assume it’s on IIS. In which case you should see in the event viewer what caused the app pool to recycle. It can be an unhandled exception in a separated thread, or the app writing anything in /bin.

  • You must to post comments
0
0

Hi all,

the problem is that when user is closing browser tab or is closing browser the dispose on main page and all his childrens isn’t called. Don’t now if is a wanted behaviour or not, we create a workaround to make sure that dispose is called also when user close browser and all the handlers are unsubscribed.

Default.html on a script

// quando l'utente chiude la finestra
// o la tab mi assicuro di fare il dispose
window.onbeforeunload = function () {
App.CompleteDispose();
};

Program.cs

[WebMethod]
public static void CompleteDispose()
{
PgMain pgMain = Application.MainPage as PgMain;
if(pgMain != null && !pgMain.IsDisposed && !pgMain.Disposing)
{
pgMain.Dispose();
}
}

We are now testing. Someone can confirm this behaviour ?
Thanks

  • You must to post comments
0
0

Hi Mark Reed and Luca,

thanks for your answers.

 

Client and us are using chrome last version.

It’s strange because this error happen also in localhost? How can be a websocket connection lost in localhost ?

 

I give more details, we need to keep all datas and all clients continuously update. So we create a static class available from every client, where every page of client can subscribe and unsubscribe. We subscribe on creation and unsubscribe on dispose (image1 and image2). One of this page use also calendar and keep it update.

 

We are doing the following and only sometimes the problem happen:

  • Open calendar and subscribe
  • Open other page like clients, and make several changes -> all data are updated
  • Close tab
  • Open new tab and new session
  • Open same page clients, and make same changes -> some time error on this “reloadData” and WebSocketException on windows event viewer.

Seems that old handler is still subscribe and try to update datas on a calendar that is not instantiated ?

 

Note: on this WebSocketException all clients are throw out from their sessions and application restart

  • You must to post comments
0
0

The WebSocket exception in the event viewer is traced by the System.Web.WebSockets and it should happen when a connection is lost, like Mark wrote. It’s not related to the “reloadData” missing method for the full calendar.

The “reloadData” unknown function problem is a javascript error. That method is called on a DataGridView or ListView to make them as for the current data page again.

What browser are you using?

  • You must to post comments
0
0

I think that is a normal exception that IIS generates when a websocket is terminated unexpectedly. I see those in my logs all the time and it is unrelated to wisej as any websocket connection can generate that error.

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.