locked
Backplane with SqlServer will crash the process in some scenario RRS feed

  • Question

  • User-1744311015 posted

    Hi,

    I got a problem when I use Backplane with SqlServer in SignalR in my Application.  The SignalR library will crash the process in the SqlReceiver when failed to access database. See follow code from the source code of the SignalR library: (The code is in the method Receive(object state))

    // NOTE: This is called from a BG thread so any uncaught exceptions will crash the process
    lock (this)
    {
        if (_disposed)
        {
          return;
        }

        var parameter = _dbProviderFactory.CreateParameter();
        parameter.ParameterName = "PayloadId";
        parameter.Value = _lastPayloadId.Value;

        _dbOperation = new ObservableDbOperation(_connectionString, _selectSql, _trace, parameter)
       {
          TracePrefix = _tracePrefix
       };
    }

    In these code, if any exception occur the process will be crashed. In my case, _lastPayloadId is null (for some reason, I failed to get the last payload id from database).

    I don't know why design it like this. Why not report the error to the application who use the SignalR library, and let it decide if need a crash. Because in many time, the SignalR is not the most important feature in my application. if it can't be started, it doesn't matter if it won't affect other feature. But now, it crash the process, the whole website is shutdown.

    Wednesday, September 16, 2015 3:56 AM

All replies