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

Reevaluate manual retry logic #20

Open
vilterp opened this issue Aug 4, 2022 · 7 comments
Open

Reevaluate manual retry logic #20

vilterp opened this issue Aug 4, 2022 · 7 comments

Comments

@vilterp
Copy link
Contributor

vilterp commented Aug 4, 2022

I think we should just remove this if statement; it should be allowed to poll forever:

if count > 5 {

The Go-idiomatic thing might be to pass in a context for this function, and on each iteration check whether the context is cancelled. (though I'm not sure whether this should go cancel the transaction on the RAI side…)

cc @NRHelmi

@NHDaly
Copy link
Member

NHDaly commented Aug 4, 2022

(In the long-term, we want to implement the same polling policy in all the SDKs: https://github.com/RelationalAI/rai-sdk-issues/issues/58. But in the meantime, just removing this if statement would help.)

@NHDaly
Copy link
Member

NHDaly commented Aug 10, 2022

Oh, @NRHelmi, we need to fix this before merging RelationalAI/rai-cli#17, otherwise all transactions longer than 10 seconds will appear to time out at the CLI! 😮

@NRHelmi
Copy link
Contributor

NRHelmi commented Aug 10, 2022

@NHDaly the count is there to abort if we exceed the 5 errors but I think it will poll forever if everything is running fine

@vilterp
Copy link
Contributor Author

vilterp commented Aug 10, 2022

Hm, I guess the count only gets incremented if there's an error:

count++

This would be easier to see if the variable is called errorCount.

Should we just bail out at the first error? Is there any precedent for this "only bail out after 5 errors" policy in other SDKs?

@NHDaly
Copy link
Member

NHDaly commented Aug 11, 2022

ooooooooooooh i see! Thank you for clarifying!

So this is like a retry policy? I think that the Julia SDK handles retries automatically through the Julia SDK:
RelationalAI/rai-sdk-julia#45
RelationalAI/rai-sdk-julia#47

Does the Golang HTTP library do any kind of retries for us automatically already?

@NHDaly
Copy link
Member

NHDaly commented Aug 11, 2022

I guess this was added per this comment, here:
#2 (comment)

I dunno what's standard here. I agree that bailing on the first error seems reasonable to me?

@billscheidel-rai
Copy link

Note: This issue has been migrated to https://relationalai.atlassian.net/browse/RAI-6269.

This link is only accessible to employees of RelationalAI.

@NHDaly NHDaly changed the title polling loop shouldn't bail out after 10 seconds Reevaluate manual retry logic Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants