Skip to content
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

predictoor.ai 5m feed is down often, bc pdr-websocket fails to renew subscription #48

Open
KatunaNorbert opened this issue Oct 31, 2023 · 9 comments · May be fixed by #49
Open

predictoor.ai 5m feed is down often, bc pdr-websocket fails to renew subscription #48

KatunaNorbert opened this issue Oct 31, 2023 · 9 comments · May be fixed by #49
Assignees
Labels
Type: Bug Something isn't working

Comments

@KatunaNorbert
Copy link
Member

KatunaNorbert commented Oct 31, 2023

Background / motivation 1 - Oct 2023

Norbert: Websocket fails when tries to renew the subscription and has to be manually restarted

Background / motivation 2 - Feb 2024

From this slack thread on Feb 19, 2024

Trent: predictoor.ai is giving a "?" for BTC 5m prediction. Any ideas why?

Trent: BTW it's not doing it for 1h prediction. (Good.) (edited)

Mustafa: I guess the websocket app has an issue

Mustafa: Can you restart it @norbert

Norbert: Yes, restarted it. It fails sometimes when trying to renew the subscription

Berkay: there's a cronjob to restart it every hour yet we frequently encounter this issue

@KatunaNorbert KatunaNorbert added the Type: Bug Something isn't working label Oct 31, 2023
@KatunaNorbert KatunaNorbert self-assigned this Oct 31, 2023
@trentmc trentmc changed the title Websocket renew subscription failure predictoor.ai 5m price feed is down too frequently; root cause is pdr-websocket failure to renew subscription Feb 19, 2024
@trentmc
Copy link
Member

trentmc commented Feb 19, 2024

We should take steps to make this more reliable, now that more eyes are on predictoor

Perhaps simply re-starting every 10min? @trizin

@trentmc trentmc changed the title predictoor.ai 5m price feed is down too frequently; root cause is pdr-websocket failure to renew subscription predictoor.ai 5m feed is down often, bc pdr-websocket fails to renew subscription Feb 19, 2024
@KatunaNorbert
Copy link
Member Author

If we are restarting it at the same time each day then the cron is probably trying to restart too early and the subscription is not expired yet. What we could do is keep track of the time it was restarted last time and add +5min to the next time so it gives some extra time for the subscription to expire before restarting.

@KatunaNorbert
Copy link
Member Author

Another solution might be switching the rpc from wss://sapphire.oasis.io/ws to the Chainstack rpc which is more reliable

@trizin
Copy link
Contributor

trizin commented Feb 19, 2024

or pdr-websocket could manage the subscription and buy a new one when it expires.

@KatunaNorbert
Copy link
Member Author

It does but it's not working.. was spending some time with @kdetry on fixing it but didn't find a solution so decided to rely on the cron approach. We could take another look again if the cron approach it's not working.

@trizin
Copy link
Contributor

trizin commented Feb 19, 2024

I updated the cronjob to restart it every 15 minutes. The startup time is around 10 seconds so we will have a downtime of 10 seconds every 15 minutes until we come up with a better solution, let's hope this works for now 🤞

@idiom-bytes
Copy link
Member

idiom-bytes commented Feb 22, 2024

It does but it's not working.. was spending some time with @kdetry on fixing it but didn't find a solution so decided to rely on the cron approach. We could take another look again if the cron approach it's not working.

Whether the cron job is working or not, having an unstable backend service isn't good. I agree with @trizin that we need to address this at the service-level (code), not system-level (cron).

There is a PR that's "ready to go", that "might fix this issue" but I can't quite validate as there are no logs/errors/trace/context as to the problem explained in the ticket... so, should the PR be getting merged? It's been there since November.

@KatunaNorbert
Copy link
Member Author

I don't think that PR fixes the issue. As far as I know it's not solved that's why it wasn't merged.
The issue I encountered is either the subscription has ended and we try to get the prediction or has not ended and we try to renew it. To sum it up the subscription renewal is well timed.

@trentmc
Copy link
Member

trentmc commented Feb 23, 2024

I don't think that PR fixes the issue. As far as I know it's not solved that's why it wasn't merged.

Correct, this is what Mustafa said a few days ago (in slack I think?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
4 participants