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

[CAT-799] Timeout Parameter Not Set Up as Expected #273

Merged
merged 4 commits into from
Nov 1, 2023

Conversation

nateshim-indico
Copy link
Contributor

@nateshim-indico nateshim-indico commented Oct 30, 2023

Summary

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • Jira story/task is put into PR title
  • Code has been self-reviewed
  • Hard-to-understand areas have been commented
  • Documentation has been updated
  • My changes generate no new warnings
  • Unit tests have been added for base functionality and known edge cases
  • Any dependent changes have been merged and published in downstream modules

def run(self):
if self.timeout == 0:
raise IndicoTimeoutError(self.timeout)
signal.signal(signal.SIGALRM, self._handler)
Copy link
Contributor

@meghanhickey meghanhickey Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh this is really slick! I dig it.

Reading the docs for the signal library, it looks like signal.SIGALARM is only available on Unix. I think we want this SDK to be usable on Windows as well. Is there a way to implement this that's more OS agnostic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yep will do!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like signal is just not overall a good choice as it's not Windows friendly in general. Just parsed out current timing logic into Timer and fixed the double time issues

@meghanhickey
Copy link
Contributor

nice! this looks good to me, but I'd hold off on merging until @goatrocks takes a look

@@ -53,7 +52,7 @@ class JobStatus(RequestChain):
Args:
id (int): id of the job to query for status.
wait (bool, optional): Wait for the job to complete? Default is True
timeout (float or int, optional): Timeout after this many seconds.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on the fix + updating the tests!

Only feedback here - there's an impact to changing the interface/accepted types -- while you could submit an int for a float, if users are submitting floats and upgrade after we narrow the accepted types to int, they will have to change their scripts.

If it's possible to accept floats here we should still. Thank you!

Copy link
Contributor

@goatrocks goatrocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you!

@nateshim-indico nateshim-indico merged commit 08bdc1b into master Nov 1, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants