Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Retry storage operation on 409 conflict#325

Merged
katrogan merged 11 commits into
flyteorg:masterfrom
sonjaer:add-retry
Jan 20, 2022
Merged

Retry storage operation on 409 conflict#325
katrogan merged 11 commits into
flyteorg:masterfrom
sonjaer:add-retry

Conversation

@sonjaer
Copy link
Copy Markdown
Contributor

@sonjaer sonjaer commented Jan 19, 2022

TL;DR

Fix for flyteorg/flyte#1997

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

How did you fix the bug, make the feature etc. Link to any design docs etc

Tracking Issue

Remove the 'fixes' keyword if there will be multiple PRs to fix the linked issue

fixes https://github.com/flyteorg/flyte/issues/

Follow-up issue

NA
OR
https://github.com/flyteorg/flyte/issues/

Comment thread pkg/common/data_store.go Outdated
Comment thread pkg/common/data_store.go Outdated
Comment thread pkg/common/data_store.go Outdated
Comment thread pkg/common/data_store.go Outdated
}
if err := storageClient.WriteProtobuf(ctx, uri, storage.Options{}, literalMap); err != nil {

err = async.RetryOnSpecificErrors(5, async.RetryDelay, func() error {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Extract to config?

Comment thread pkg/common/data_store.go Outdated
}

func isRetryableError(err error) bool {
if e, ok := err.(*googleapi.Error); ok && e.Code == 409 {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

A bit hard to reproduce this as my local version does not connect to GCP and even if I am not sure I could get this error to reappear. I used this https://github.com/graymeta/stow/blob/973a61f346d598a566affb53c4698764a67df164/google/location.go#L38-L42 to understand how to parse it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this looks right, but it also looks like flytestdlib wraps the error: https://github.com/flyteorg/flytestdlib/blob/15cac7bec8470974050ed02343cda8191e5f14bc/storage/stow_store.go#L264 so you may need to unwrap the error. I think IsCausedBy works here to get the underlying googleapi error.

Mind adding a unit test to verify this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed 👍

@sonjaer sonjaer force-pushed the add-retry branch 2 times, most recently from e9c716c to 1d66278 Compare January 19, 2022 15:38
@sonjaer sonjaer changed the title Add retry wip Retry storage operation on 409 conflict Jan 19, 2022
@sonjaer sonjaer marked this pull request as ready for review January 19, 2022 15:40
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 19, 2022

Codecov Report

Merging #325 (4960a4b) into master (185e449) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #325      +/-   ##
==========================================
+ Coverage   58.10%   58.16%   +0.06%     
==========================================
  Files         148      148              
  Lines       10691    10707      +16     
==========================================
+ Hits         6212     6228      +16     
  Misses       3796     3796              
  Partials      683      683              
Flag Coverage Δ
unittests 56.92% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/async/shared.go 100.00% <100.00%> (ø)
pkg/common/data_store.go 90.90% <100.00%> (+7.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 185e449...4960a4b. Read the comment docs.

@sonjaer sonjaer force-pushed the add-retry branch 4 times, most recently from a169adc to e4ac309 Compare January 20, 2022 10:24
Signed-off-by: Sonja Ericsson <sonjae@spotify.com>
Signed-off-by: Sonja Ericsson <sonjae@spotify.com>
Signed-off-by: Sonja Ericsson <sonjae@spotify.com>
Signed-off-by: Sonja Ericsson <sonjae@spotify.com>
Signed-off-by: Sonja Ericsson <sonjae@spotify.com>
Signed-off-by: Sonja Ericsson <sonjae@spotify.com>
Signed-off-by: Sonja Ericsson <sonjae@spotify.com>
Signed-off-by: Sonja Ericsson <sonjae@spotify.com>
Signed-off-by: Sonja Ericsson <sonjae@spotify.com>
Signed-off-by: Sonja Ericsson <sonjae@spotify.com>
Signed-off-by: Sonja Ericsson <sonjae@spotify.com>
@katrogan katrogan merged commit 6fa5b48 into flyteorg:master Jan 20, 2022
@welcome
Copy link
Copy Markdown

welcome Bot commented Jan 20, 2022

Congrats on merging your first pull request! 🎉

eapolinario pushed a commit that referenced this pull request Sep 6, 2023
* add retry wip

Signed-off-by: Sonja Ericsson <sonjae@spotify.com>

* fix

Signed-off-by: Sonja Ericsson <sonjae@spotify.com>

* fix

Signed-off-by: Sonja Ericsson <sonjae@spotify.com>

* fix

Signed-off-by: Sonja Ericsson <sonjae@spotify.com>

* add tests

Signed-off-by: Sonja Ericsson <sonjae@spotify.com>

* fix

Signed-off-by: Sonja Ericsson <sonjae@spotify.com>

* fix

Signed-off-by: Sonja Ericsson <sonjae@spotify.com>

* fix

Signed-off-by: Sonja Ericsson <sonjae@spotify.com>

* fix

Signed-off-by: Sonja Ericsson <sonjae@spotify.com>

* fix

Signed-off-by: Sonja Ericsson <sonjae@spotify.com>

* fix lint

Signed-off-by: Sonja Ericsson <sonjae@spotify.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants