Skip to content

Add Try-Catch handling during ResetTDSConnection and TDS_INIT_PHASE#3787

Merged
shardgupta merged 1 commit intobabelfish-for-postgresql:BABEL_2_X_DEVfrom
amazon-aurora:BABEL-4584-2x
May 28, 2025
Merged

Add Try-Catch handling during ResetTDSConnection and TDS_INIT_PHASE#3787
shardgupta merged 1 commit intobabelfish-for-postgresql:BABEL_2_X_DEVfrom
amazon-aurora:BABEL-4584-2x

Conversation

@Anikait143
Copy link
Copy Markdown
Contributor

Description

This commit wraps ResetTDSConnection and TDS_INIT_PHASE within a Try-Catch block to handle corrupted memory and errors due to uncommon conditions such as OOM resulting in a crash. We will now terminate the connection by throwing a fatal error upon catching such issues.

cherry-picked: #3784

Task: BABEL- 4584
Authored-by: Anikait Agrawal agraani@amazon.com
Signed-off-by: Anikait Agrawal agraani@amazon.com

Testing Details

Tested locally by throwing an error during ResetTdsConnection, which earlier resulted in a crash, now fixed by terminating the connection.

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…abelfish-for-postgresql#3784)

This commit wraps ResetTDSConnection and TDS_INIT_PHASE within a Try-Catch block to handle corrupted memory and errors due to uncommon conditions such as OOM resulting in a crash. We will now terminate the connection by throwing a fatal error upon catching such issues.

Task: BABEL- 4584
Authored-by: Anikait Agrawal agraani@amazon.com
Signed-off-by: Anikait Agrawal agraani@amazon.com
@shardgupta shardgupta merged commit 458945d into babelfish-for-postgresql:BABEL_2_X_DEV May 28, 2025
30 checks passed
@shardgupta shardgupta deleted the BABEL-4584-2x branch May 28, 2025 11:22
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.

3 participants