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

fix: Remove Begin transaction on non retryable error #2168

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

surbhigarg92
Copy link
Contributor

No description provided.

@surbhigarg92 surbhigarg92 requested review from a team as code owners October 21, 2024 12:20
@product-auto-label 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
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);
})
Copy link
Contributor

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?

@surbhigarg92 surbhigarg92 force-pushed the begin_on_non_retryable_error branch from d48d83b to f321749 Compare October 25, 2024 07:32
@surbhigarg92 surbhigarg92 requested a review from a team as a code owner October 25, 2024 07:32
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants