RESOLVED FIXED 43902
flaky websocket/tests/frame-length-overflow.html
https://bugs.webkit.org/show_bug.cgi?id=43902
Summary flaky websocket/tests/frame-length-overflow.html
Fumitoshi Ukai
Reported 2010-08-12 02:30:58 PDT
chrome buildbot shows flaky failures of websocket/tests/frame-length-overflow.html http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=websocket%2Ftests%2Fframe-length-overflow.html Actual test looks like: Make sure WebSocket does not crash and report error when it sees length overflow On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". WebSocket is open WebSocket received error frame WebSocket received error frame WebSocket is closed PASS successfullyParsed is true TEST COMPLETE So, it received 2 error event before close. I guess it would happen as follows: processBuffer post error event and leave buffer unchanged. before didClose is called, message loops runs again (more data comes from network or so) and calls processBuffer again (via didReceivedData or resumeTimerFired) it sees the same buffer again and post error event
Attachments
Patch (3.69 KB, patch)
2010-08-12 02:37 PDT, Fumitoshi Ukai
no flags
Patch (3.70 KB, patch)
2010-08-12 03:02 PDT, Fumitoshi Ukai
no flags
Patch (3.88 KB, patch)
2010-08-12 22:22 PDT, Fumitoshi Ukai
no flags
Patch (3.83 KB, patch)
2010-08-13 00:59 PDT, Fumitoshi Ukai
ap: review+
Fumitoshi Ukai
Comment 1 2010-08-12 02:37:38 PDT
Early Warning System Bot
Comment 2 2010-08-12 02:44:17 PDT
Fumitoshi Ukai
Comment 3 2010-08-12 03:02:37 PDT
WebKit Review Bot
Comment 4 2010-08-12 03:23:06 PDT
Alexey Proskuryakov
Comment 5 2010-08-12 07:38:43 PDT
Comment on attachment 64200 [details] Patch > + , m_errorClosed(false) I don't like this name, it sounds as if the error itself were somehow closed. When is this variable set to true? If you can explain it in a full English sentence, that may help come up with a good variable name. > + skipBuffer(m_bufferSize); // Release buffer. We don't read any more data. A comment saying why we're doing this would be more helpful than one saying what we're doing. Is this so save memory? + if (m_errorClosed) + return false; Indentation is incorrect here.
Fumitoshi Ukai
Comment 6 2010-08-12 22:22:05 PDT
(In reply to comment #5) > (From update of attachment 64200 [details]) > > + , m_errorClosed(false) > > I don't like this name, it sounds as if the error itself were somehow closed. When is this variable set to true? If you can explain it in a full English sentence, that may help come up with a good variable name. how about m_readShutdowned. It means the channel won't receive any more data, like SHUT_RD. > > + skipBuffer(m_bufferSize); // Release buffer. We don't read any more data. > > A comment saying why we're doing this would be more helpful than one saying what we're doing. Is this so save memory? Yes. and make sure it doesn't read the same buffer again. > + if (m_errorClosed) > + return false; > > Indentation is incorrect here.
Fumitoshi Ukai
Comment 7 2010-08-12 22:22:23 PDT
Alexey Proskuryakov
Comment 8 2010-08-12 23:10:50 PDT
+ , m_readShutdowned(false) Shutdown is not a verb, so this should be "m_readShutDown" for better grammar. > It means the channel won't receive any more data, like SHUT_RD. This sounds like something we should be asking the channel about then, not something to keep in WebSocket object. If it's better to keep this in WebSocket, then the name needs to be different yet, indicating what it means from this code point of view. > Yes. and make sure it doesn't read the same buffer again. Doesn't setting m_errorClosed/m_readShutdowned already prevent that?
Fumitoshi Ukai
Comment 9 2010-08-12 23:55:19 PDT
(In reply to comment #8) > + , m_readShutdowned(false) > > Shutdown is not a verb, so this should be "m_readShutDown" for better grammar. > > > It means the channel won't receive any more data, like SHUT_RD. > > This sounds like something we should be asking the channel about then, not something to keep in WebSocket object. If it's better to keep this in WebSocket, then the name needs to be different yet, indicating what it means from this code point of view. Hmm, how about m_readClosed, or m_shouldDiscardReceivedData ? > > Yes. and make sure it doesn't read the same buffer again. > > Doesn't setting m_errorClosed/m_readShutdowned already prevent that? Ah, yes.
Alexey Proskuryakov
Comment 10 2010-08-13 00:07:13 PDT
m_shouldDiscardReceivedData sounds like the best option so far.
Fumitoshi Ukai
Comment 11 2010-08-13 00:59:03 PDT
Fumitoshi Ukai
Comment 12 2010-08-13 05:02:22 PDT
Note You need to log in before you can comment on or make changes to this bug.