Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Exponential backoff does not work #17

Open
bgourlie opened this issue Feb 12, 2017 · 3 comments
Open

Exponential backoff does not work #17

bgourlie opened this issue Feb 12, 2017 · 3 comments

Comments

@bgourlie
Copy link

bgourlie commented Feb 12, 2017

Elm Version: 0.18
OS: Mac OS X
Browser: Chrome
SSCCE:

Because this is a bug internal to the websocket library, it can't be illustrated in an isolated example. Here are the simplest steps to reproduce:

  • Make a local copy of the echo example
  • Manually edit Websocket.elm in the elm-stuff/packages/websocket/1.0.2 directory. Add log statements to this line and this line so that you can see when they are fired.
  • Change the echoServer uri to something bogus to trigger reconnect behavior and run the application
  • Check the console and notice that the debug statement on this line is never executed, which is responsible for incrementing the connect attempt count that the backoff strategy is dependent on.

Detailed description:

The BadOpen message is never dispatched, presumably because the Die message is dispatched with every failed connect attempt. This appears to be happening because the native websocket onClose handler is fired every failed connect attempt, and then onSelfMsg handles the Die message, resetting the connection state.

It appears that the browser itself does some sort of connection throttling, which may be why this issue has gone unnoticed.

@process-bot
Copy link

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

bgourlie added a commit to bgourlie/websocket that referenced this issue Feb 12, 2017
@drathier
Copy link

drathier commented Dec 9, 2017

I have seen exponential backoff in chrome (just a few minutes ago), but seem to get a constant rate of about 5 retries per second in safari doing the same thing. Now I'm getting one request every 3 seconds in chrome.

@bgourlie
Copy link
Author

bgourlie commented Dec 9, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants