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

Dedicated return value on "deadline exceeded" ('--wait' timeout) #1675

Closed
RubenKelevra opened this issue May 24, 2022 · 4 comments · Fixed by #2057
Closed

Dedicated return value on "deadline exceeded" ('--wait' timeout) #1675

RubenKelevra opened this issue May 24, 2022 · 4 comments · Fixed by #2057
Assignees
Labels
effort/hours Estimated to take one or several hours exp/beginner Can be confidently tackled by newcomers good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked

Comments

@RubenKelevra
Copy link
Collaborator

RubenKelevra commented May 24, 2022

Describe the feature you are proposing

Currently, an operation might be time-limited and there's a message reporting this back. But it would be great if the return code could be not 1 in this case, but something distinctive to be easily able to identify the reason for the failure - without parsing the message itself.

[ipfs@odin ~]$ ipfs-cluster-ctl pin update --wait --wait-timeout 600s $oldcid $newcid
error waiting for pin status: context deadline exceeded
[ipfs@odin ~]$ echo $?
1

Additional context

I guess 62 would be the "correct" one:

$ grep "define" /usr/include/asm-generic/*err* | grep -i time
/usr/include/asm-generic/errno.h:#define        ETIME           62      /* Timer expired */
/usr/include/asm-generic/errno.h:#define        ETIMEDOUT       110     /* Connection timed out */

Or if this operation is still beeing completed and just the "reporting" is aborted, we might want to use 115 instead.

$ grep "define" /usr/include/asm-generic/*err* | grep -i operation | grep -i -E "progress|canceled"
/usr/include/asm-generic/errno.h:#define        EALREADY        114     /* Operation already in progress */
/usr/include/asm-generic/errno.h:#define        EINPROGRESS     115     /* Operation now in progress */
/usr/include/asm-generic/errno.h:#define        ECANCELED       125     /* Operation Canceled */
@RubenKelevra RubenKelevra added the need/triage Needs initial labeling and prioritization label May 24, 2022
@RubenKelevra RubenKelevra changed the title Dedicated return value on "deadline exceeded" Dedicated return value on "deadline exceeded" ('--wait' timeout) May 24, 2022
@hsanjuan hsanjuan added kind/enhancement A net-new feature or improvement to an existing feature help wanted Seeking public contribution on this issue good first issue Good issue for new contributors exp/beginner Can be confidently tackled by newcomers effort/hours Estimated to take one or several hours status/ready Ready to be worked and removed need/triage Needs initial labeling and prioritization labels Mar 3, 2023
@ohmpatel1997
Copy link
Contributor

Do we have a set of codes in mind to return for example in case of cancelled, deadline exceeded, any other (500) may be?

@hsanjuan
Copy link
Collaborator

Maybe just try 62 and 125 depending on whether it is an error coming from an expired context or from a cancelled context. I think this can be done in the formatResponse method.

@ohmpatel1997
Copy link
Contributor

Maybe just try 62 and 125 depending on whether it is an error coming from an expired context or from a cancelled context. I think this can be done in the formatResponse method.

got it, thanks, Can you please give me write access, I can not able to push my feature branch to the repo for PR.

@hsanjuan
Copy link
Collaborator

got it, thanks, Can you please give me write access, I can not able to push my feature branch to the repo for PR.

Please send it from a fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours exp/beginner Can be confidently tackled by newcomers good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants