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
Lightstreamer stops after 2 hours #113
Comments
I've made a workaround : |
In my opinion this shouldn't be a concern of the "end user" or someone using the library. The library should handle this. Thanks for your workaround @sacharbit could be a good solution until this is implemented in the library. It appears that other libraries handle a "LOOP" message. There is useful thread here: https://labs.ig.com/node/162 that talks about using the HEARTBEAT epic which apparently keeps your session from expiring or whatever the LOOP message means has happened. This could be another workaround. I've successfully got a HEARTBEAT subscription working and I'm currently running it with a debug log level. If I don't report back here then you can probably assume that the HEARTBEAT subscription solves the issue for me. Back to the library though, which is where I think the LOOP should be handled. I'll raise an issue to discuss if it's already handled somehow and I can have a go at doing what needs to be done when a LOOP message occurs. For those wanting to implement a HEARTBEAT workaround, I did it like so, just under my other subscriptions:
Then I have an "on_update" method that really does nothing apart from print so I know it's doing something:
Just for completeness (which I sometimes find lacking in the Python community), if you need debug level log, then add this:
|
Well that heartbeat didn't solve it for me. |
So I made sure to be up to date with what's in Master and ran my stream in debug mode. I expected it to fail but by the time I went to bed it was still running and it was even still running in the morning. I looked back through the log and could see it rebinding successfully. I've updated everything on my server and am now running it with logging turned on. Hopefully it's just to ensure you're running the latest code to fix this issue. |
Nope, got a LOOP with no rebind. |
woaw! That was a rollercoaster of emotions :D |
Make sure that in lightstreamer file in line around 350, you have rebind=True and receive=False |
@oliverpolden Have you made progress on handling LOOP in the library? If not I will give it a try; been facing that same issue and I'm tired of it! But wouldn't want to start from scratch if you've already got uncommitted code. -Edit- @sacharbit There is a rebind variable indeed. It looks like there is some kind of handling of LOOP commands already, have you been able to verify that it definitely works? |
No I’m afraid not.
… On 5 Jul 2020, at 13:52, RRMXkun ***@***.***> wrote:
@oliverpolden Have you made progress on handling LOOP in the library? If not I will give it a try; been facing that same issue and I'm tired of it! But wouldn't want to start from scratch if you've already got uncommitted code.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I've made a pull request. Basically, you have to add the version and LS_CONTENT_LENGTH. |
Pull request has been merged in |
Hi, I'm seeing a disconnect after about 6 hours, and experienced this every time I've subscribed. I'm curious about the setting Message = None, and then stopping the While Loop by setting receive = False, when I received a Timeout. Here is my stack trace. Is there a way to handle the connection drops for this timeout error? Would adding rebind = True in the first If Message is None cause issues? Traceback (most recent call last): |
Yes it would, the connection is still active at this point we just received an empty message, so we wouldn't want to rebind at this stage. By the time you receive the error you're seeing we're already out of the loop as en exception has been raised by this part of the code:
Therefore you will never reach the if message=None part. The only way to address this that I can see is to make use of the Heartbeat:
and re-establish a connection if the heartbeat stops. We could try to implement this in the LSClient class of lightstreamer.py. |
Hello everyone,
Hope you're all ok in those tough times,
I have an issue with the lightstreamer stream api : it works fine for about 2 hours and then stops.
I have found online that it's a problem with the LOOP that "finishes its natural cycle" so I need to reconnect and subscribe to all the feeds that I had but I can't find a way to detect that "end of cycle".
I tried to log something everytime I receive a loop message but I don't log anything.
Please help! It drives me crazy! :)
Thanks in advance,
Sacha
The text was updated successfully, but these errors were encountered: