-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exception in xhr-multipart.js (in 0.6.17) when client.send() is called #189
Comments
That just happened again. But this time appears that the call was initiated by a timer (most likely created by the library) and did not go through my code. This is the full stack trace of the call which happens to be sending a hartbeat message: |
We are seeing this issue as well. The object exists at the point of the if conditional (line 62) but appears to be null after the first write. I think the response is getting deallocated, possibly due to the behavior of response.write as noted in the node documentation: "The first time response.write() is called, it will send the buffered header information and the first body to the client. The second time response.write() is called, Node assumes you're going to be streaming data, and sends that separately. That is, the response is buffered up to the first chunk of body." One thing to note, we ONLY see this behavior when using https.. it seems to work fine over http. |
I can confirm that this issue still persists in 0.6.18. Very interesting that this is potentially a HTTPS only issue - we are finding this error in HTTPS as well.... |
Do you think it is safe to ignore this exception? Will the library cleanup correctly and remain stable and working properly? |
I can reproduce this issue by setting up a standard node server and directly requesting the following URL: Where "25785" is the port and "transaction" is the resource. Currently using the uncaught exception handler and things seem to be stable for a short-term fix: |
Yesterday we updated to 0.6.17 and those exceptions started to pop:
TypeError: Cannot call method 'write' of null
at [object Object]._write (/root/root/.npm/socket.io/0.6.17/package/lib/socket.io/transports/xhr-multipart.js:64:19)
at [object Object].send (/root/root/.npm/socket.io/0.6.17/package/lib/socket.io/client.js:32:8)
at ....
The code that throws it is:
63: this.response.write("Content-Type: text/plain" + (message.length === 1 && message.charCodeAt(0) === 6 ? "; charset=us-ascii" : "") + "\n\n");
64: this.response.write(message + "\n"); // this throws the exception because this.response is null !?!?
so appears that somehow the "response" property is null on line 64 but has been still there on line 63.
I'm trying to figure out when exactly it happens and if this may be due to a fault on our other code but so far it does not seem so. On the next fail I'll have a print of the "message" to check if that may have gone terribly wrong (a simple object is passed to .send() so should be nothing unusual).
The text was updated successfully, but these errors were encountered: