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

Workaround GTC-2986 by checking if version is successfully created after get 5XX response from API #153

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

jterry64
Copy link
Member

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your master!
  • Make sure you are making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Check the commit's or even all commits' message styles matches our requested structure.
  • Check your code additions will fail neither code linting checks nor unit test.

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

We often see during nightly jobs to create new GLAD/integrated alerts tables a 500 response from the API on version creation, but the version often actually does get created. This then gives a 400 error on retry that the version already exists, and causes us to error out before finishing the sync job, even though the table was actually successfully uploaded.

What is the new behavior?

On getting error from creating new version, check if version did successfully get created before returning an exception.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@jterry64 jterry64 changed the base branch from master to develop September 12, 2024 15:44
@jterry64 jterry64 changed the base branch from develop to master September 12, 2024 15:46
@jterry64 jterry64 changed the base branch from master to develop September 12, 2024 15:46
Copy link
Contributor

@danscales danscales left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! Looks good, except for possibly extraneous change to create_aux_asset()

uri = f"{GLOBALS.data_api_uri}/dataset/{dataset}/{version}/assets"
return self._send_request(ValidMethods.post, uri, payload)["data"]
return self.get_version(ValidMethods.post, uri, payload)["data"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Was there a bad merge here? I don't see any reason to change create_aux_asset() to use get_version(), and it is the wrong set of args for get_version.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh possibly, I had to backwards merge some hotfixes from master to develop that may have gotten mixed up

Copy link
Member Author

Choose a reason for hiding this comment

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

removed

@jterry64 jterry64 merged commit 3df7213 into develop Sep 16, 2024
3 checks passed
@jterry64 jterry64 deleted the batman/workaround_gtc-2986 branch September 16, 2024 20:45
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.

2 participants