Closed
Conversation
There was a problem hiding this comment.
Hi, @NJrslv welcome!🎊 Thanks for taking the effort to make our project better! 🙌 Keep making such awesome contributions!
Author
|
lets just get this commit from apache/cloudberry apache@c305e7b |
2 similar comments
Author
|
lets just get this commit from apache/cloudberry apache@c305e7b |
Author
|
lets just get this commit from apache/cloudberry apache@c305e7b |
leborchuk
pushed a commit
that referenced
this pull request
Feb 10, 2026
We faced an issue - segments fail with backtrace ``` #7 0x00007f9b2adbf2e0 in set_qi_error_message (req=0x55f24a6011f0) at src/ProtoUtils.cpp:124 #8 0x00007f9b2adc30d9 in EventSender::collect_query_done (this=0x55f24a5489f0, query_desc=0x55f24a71ca68, status=METRICS_QUERY_ERROR) at src/EventSender.cpp:222 #9 0x00007f9b2adc23e1 in EventSender::query_metrics_collect (this=0x55f24a5489f0, status=METRICS_QUERY_ERROR, arg=0x55f24a71ca68) at src/EventSender.cpp:53 ``` the root cause here is we're trying to send info about error message in a hooks collector. For some queries ErrorData struckture could be NULL despite the fact that an error has occurred. it depends on error type and location of the error. So we should check if we had info about error details before using it.
leborchuk
pushed a commit
that referenced
this pull request
Mar 18, 2026
We faced an issue - segments fail with backtrace ``` #7 0x00007f9b2adbf2e0 in set_qi_error_message (req=0x55f24a6011f0) at src/ProtoUtils.cpp:124 #8 0x00007f9b2adc30d9 in EventSender::collect_query_done (this=0x55f24a5489f0, query_desc=0x55f24a71ca68, status=METRICS_QUERY_ERROR) at src/EventSender.cpp:222 #9 0x00007f9b2adc23e1 in EventSender::query_metrics_collect (this=0x55f24a5489f0, status=METRICS_QUERY_ERROR, arg=0x55f24a71ca68) at src/EventSender.cpp:53 ``` the root cause here is we're trying to send info about error message in a hooks collector. For some queries ErrorData struckture could be NULL despite the fact that an error has occurred. it depends on error type and location of the error. So we should check if we had info about error details before using it.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
This PR fixes a crash,
std::terminate(), caused by an exception occurring in the catch block ofGPOPTOptimizedPlan()duringgpopt_context.CloneErrorMsg().When
CloneErrorMsgfails (typically due to OOM), it throws agpdberror, causingstd::terminate().Postgres has graceful error handling for errors that occur while processing other errors - even during OOM, the
ErrorContexthas reserved space to preserve error messages.So rethrow the error to postgres handler.
Test Plan
Added a new test to the regression
gporca_faulttest.I added a query that errors out during optimization in orca and as the result falls into
catchblock where another exception inCloneErrorMsgis thrown via inject fault.Previously it resulted in the
std::terminate()call & process crashing. Now catch the exception and let the postgres handle it with reserved buffer to preserve error message.Impact
Instead of
server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.postgres reports an error (in case of OOM we will see it, not std::terminate with exiting processes):