azure-contrib / socket.io-servicebus

socket.io store which uses Service Bus pub/sub for scale out
Apache License 2.0
30 stars 14 forks source link

Crash when get 500 response from Service Bus #41

Closed jcookems closed 11 years ago

jcookems commented 11 years ago

I hooked up Fiddler to capture the SB traffic, and chose one of the requests to return a 500:

HTTP/1.1 500 No Content
Content-Length: 0
Content-Type: application/xml; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Mon, 11 Mar 2013 23:06:44 GMT

That causes an crash:

...chat\node_modules\socket.io-servicebus\lib\servicebusconnector.js:97
    name: message.brokerProperties.Label,
                                  ^
TypeError: Cannot read property 'Label' of undefined
    at ServiceBusConnector.unpackMessage (...chat\node_modules\socket.io-servicebus\lib\servicebusconnector.js:97:35)
    at ...chat\node_modules\socket.io-servicebus\lib\servicebusconnector.js:48:24
    at ...chat\node_modules\socket.io-servicebus\node_modules\azure\lib\services\serviceBus\servicebusservice.js:359:7
    at ...chat\node_modules\socket.io-servicebus\node_modules\azure\lib\services\core\serviceclient.js:601:11
    at ...chat\node_modules\socket.io-servicebus\node_modules\azure\lib\services\serviceBus\servicebusservice.js:362:5
    at Request._callback (...chat\node_modules\socket.io-servicebus\node_modules\azure\lib\services\core\serviceclient.js:228:11)
    at Request.callback (...chat\node_modules\socket.io-servicebus\node_modules\azure\node_modules\request\main.js:127:22)
    at Request.<anonymous> (native)
    at Request.emit (events.js:70:17)
    at Request.<anonymous> (...chat\node_modules\socket.io-servicebus\node_modules\azure\node_modules\request\main.js:767:16)

I would expect that any issues in parsing the SB response would be caught and logged, not cause failures

christav commented 11 years ago

Should be fixed by the same PR that fixes #8. Although it is odd that it went through the parsing logic, this should have been detected as an error and not tried to parse anything.

christav commented 11 years ago

No test activity, closing this. If it occurs again reopen.