-
Notifications
You must be signed in to change notification settings - Fork 103
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
fix: Remove Begin transaction on non retryable error #2168
Open
surbhigarg92
wants to merge
22
commits into
googleapis:main
Choose a base branch
from
surbhigarg92:begin_on_non_retryable_error
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix: Remove Begin transaction on non retryable error #2168
surbhigarg92
wants to merge
22
commits into
googleapis:main
from
surbhigarg92:begin_on_non_retryable_error
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
product-auto-label
bot
added
size: l
Pull request size is large.
api: spanner
Issues related to the googleapis/nodejs-spanner API.
labels
Oct 21, 2024
surbhigarg92
force-pushed
the
begin_on_non_retryable_error
branch
from
October 21, 2024 15:07
ed10ef2
to
e1c3097
Compare
product-auto-label
bot
added
size: m
Pull request size is medium.
and removed
size: l
Pull request size is large.
labels
Oct 21, 2024
surbhigarg92
force-pushed
the
begin_on_non_retryable_error
branch
from
October 21, 2024 15:09
e1c3097
to
65acc23
Compare
odeke-em
reviewed
Oct 23, 2024
src/transaction.ts
Outdated
Comment on lines
746
to
775
.on('error', err => { | ||
const isServiceError = | ||
err && typeof err === 'object' && 'code' in err; | ||
if ( | ||
!this.id && | ||
this._useInRunner && | ||
!( | ||
isServiceError && | ||
(err as grpc.ServiceError).code === grpc.status.ABORTED | ||
) | ||
) { | ||
this.begin(); | ||
} | ||
setSpanError(span, err); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe that the right fix is to delete this code but rather to check that the error is retryable by checking if these grpc error codes are returned:
- DEADLINE_EXCEEDED
- UNAVAILABLE
- INTERNAL
although I guess the next step is to ask after this.begin() what happens next?
Extracted out of PR googleapis#2158, this change traces Database.runTransactionAsync. Updates googleapis#2079
surbhigarg92
force-pushed
the
begin_on_non_retryable_error
branch
from
October 25, 2024 07:32
d48d83b
to
f321749
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api: spanner
Issues related to the googleapis/nodejs-spanner API.
size: m
Pull request size is medium.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.