Skip to content

Old subs from previous connection are never resubscribed. #800

Closed

Activity

  1. justinpolygon commented on Dec 4, 2024

    @justinpolygon
    Collaborator

    Hey @bryaan, can you provide a little more information about what you're seeing and how I can reproduce this? I just wanted to more sure I can reproduce it and verify the fix.

  2. bryaan commented on Dec 4, 2024

    @bryaan
    Author

    If the websocket disconnects and retries and succeeds, the old subs are not resubbed.

  3. justinpolygon commented on Dec 4, 2024

    @justinpolygon
    Collaborator

    Perfect, thanks @bryaan. I'll check it out.

  4. bryaan commented on Dec 4, 2024

    @bryaan
    Author

    It seems if i set reconnects to 0 and write a loop for connect and manually resub it works. So the issue looks confirmed with the internal resub logic.

  5. justinpolygon commented on Dec 4, 2024

    @justinpolygon
    Collaborator

    Cool, thanks for checking @bryaan.

  6. self-assigned this
    on Dec 4, 2024
  7. bryaan commented on Dec 4, 2024

    @bryaan
    Author

    Actually there seems to be another issue at work. I am subscribing to 4000+ symbols, the ws seems to either stop processing after some point or it's disconnecting and not returning. I turned on verbose logging to see if I can narrow it down.

  8. justinpolygon commented on Dec 4, 2024

    @justinpolygon
    Collaborator

    Hey @bryaan, another option might be to something like subscribing to * all tickers and then in your code narrowing it down to what you're interested in. I remember doing something similar way back and it seemed to be easier to do it that way. Just less complex code handling everything. Then, you'll just have a map or something that quickly checks to see if the ticker you're seeing from the websocket is the ticker you're interested in. I guess it depends on what you're doing but for all of NASDAQ and NYSE it's something like 5300 tickers. So, you're almost looking at everything anyways.

  9. bryaan commented on Dec 4, 2024

    @bryaan
    Author

    But why would your suggestion work and this does not? I'm subbing like this:

    self.ws_client.subscribe(*tickers_to_sub) # multiple tickers
    

    Could it be a server error where they are keeping the connection open but not sending data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions