You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Jason Fehr (Code Review)" <ge...@cloudera.org> on 2025/09/15 16:16:12 UTC
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Jason Fehr has uploaded this change for review. ( http://gerrit.cloudera.org:8080/23422
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
All functions in the SpanManager class operate under the assumption
that child_span_mu_ in the SpanManager class will be locked before
the ClientRequestState lock. However, the
ImpalaServer::ExecuteInternal function takes the ClientRequestState
lock before calling SpanManager::EndChildSpanPlanning. If another
function in the SpanManager class has already taken the
child_span_mu_ lock and is waiting for the ClientRequestState lock,
a deadlock occurs.
This issue was found by running end-to-end tests with OpenTelemetry
tracing enabled and a release buildof Impala.
Testing accomplished by re-running the end-to-end tests with
OpenTelemetry tracing enabled and verifying that the deadlock no
longer occurs.
Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
---
M be/src/observe/span-manager.cc
M be/src/service/impala-server.cc
2 files changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/22/23422/1
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 3: Code-Review+2
This is an acceptable fix. I'm just exploring if there are ways to optimize it a bit.
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 3
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 21:06:57 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 3:
Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/12485/ DRY_RUN=true
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 3
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 20:24:36 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Jason Fehr (Code Review)" <ge...@cloudera.org>.
Jason Fehr has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
All functions in the SpanManager class operate under the assumption
that child_span_mu_ in the SpanManager class will be locked before
the ClientRequestState lock. However, the
ImpalaServer::ExecuteInternal function takes the ClientRequestState
lock before calling SpanManager::EndChildSpanPlanning. If another
function in the SpanManager class has already taken the
child_span_mu_ lock and is waiting for the ClientRequestState lock,
a deadlock occurs.
This issue was found by running end-to-end tests with OpenTelemetry
tracing enabled and a release buildof Impala.
Testing accomplished by re-running the end-to-end tests with
OpenTelemetry tracing enabled and verifying that the deadlock no
longer occurs.
Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Reviewed-on: http://gerrit.cloudera.org:8080/23422
Reviewed-by: Joe McDonnell <jo...@cloudera.com>
Reviewed-by: Michael Smith <mi...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M be/src/observe/span-manager.cc
M be/src/observe/span-manager.h
M be/src/service/impala-server.cc
3 files changed, 8 insertions(+), 8 deletions(-)
Approvals:
Joe McDonnell: Looks good to me, but someone else must approve
Michael Smith: Looks good to me, approved
Impala Public Jenkins: Verified
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 4
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 1:
(3 comments)
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/observe/span-manager.cc
File be/src/observe/span-manager.cc:
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/observe/span-manager.cc@255
PS1, Line 255: lock_guard<mutex> crs_lock(*(client_request_state_->lock()));
The comment in span-manager.h is now wrong. It looks like this now treats EndChildSpanPlanning the same as the other End functions.
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/service/impala-server.cc
File be/src/service/impala-server.cc:
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/service/impala-server.cc@1380
PS1, Line 1380: lock_guard<mutex> l(*(*query_handle)->lock());
This is where the prior lock on ClientRequestState is taken.
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/service/impala-server.cc@1428
PS1, Line 1428: (*query_handle)->otel_span_manager()->EndChildSpanPlanning();
Having to release then reclaim the lock here is inconvenient, but seems necessary.
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 16:21:16 +0000
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Joe McDonnell (Code Review)" <ge...@cloudera.org>.
Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 3: Code-Review+1
This looks good to me, I think we can get precommit running on this.
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 3
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 20:17:59 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 3:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/service/impala-server.cc
File be/src/service/impala-server.cc:
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/service/impala-server.cc@1428
PS1, Line 1428: (*query_handle)->otel_span_manager()->EndChildSpanPlanning();
> It would not. There are places where child_span_mu_ is locked without also
I was wondering if we could switch the order everywhere. We wouldn't always need to take the ClientRequestState lock, just never take it after child_span_mu_.
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 3
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 21:06:21 +0000
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Jason Fehr (Code Review)" <ge...@cloudera.org>.
Hello Abhishek Rawat, Michael Smith, Joe McDonnell, Impala Public Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/23422
to look at the new patch set (#3).
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
All functions in the SpanManager class operate under the assumption
that child_span_mu_ in the SpanManager class will be locked before
the ClientRequestState lock. However, the
ImpalaServer::ExecuteInternal function takes the ClientRequestState
lock before calling SpanManager::EndChildSpanPlanning. If another
function in the SpanManager class has already taken the
child_span_mu_ lock and is waiting for the ClientRequestState lock,
a deadlock occurs.
This issue was found by running end-to-end tests with OpenTelemetry
tracing enabled and a release buildof Impala.
Testing accomplished by re-running the end-to-end tests with
OpenTelemetry tracing enabled and verifying that the deadlock no
longer occurs.
Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
---
M be/src/observe/span-manager.cc
M be/src/observe/span-manager.h
M be/src/service/impala-server.cc
3 files changed, 8 insertions(+), 8 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/22/23422/3
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 3
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Jason Fehr (Code Review)" <ge...@cloudera.org>.
Jason Fehr has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 1:
(3 comments)
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/observe/span-manager.cc
File be/src/observe/span-manager.cc:
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/observe/span-manager.cc@255
PS1, Line 255: lock_guard<mutex> crs_lock(*(client_request_state_->lock()));
> The comment in span-manager.h is now wrong. It looks like this now treats E
Done
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/service/impala-server.cc
File be/src/service/impala-server.cc:
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/service/impala-server.cc@1380
PS1, Line 1380: lock_guard<mutex> l(*(*query_handle)->lock());
> This is where the prior lock on ClientRequestState is taken.
Yes.
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/service/impala-server.cc@1428
PS1, Line 1428: (*query_handle)->otel_span_manager()->EndChildSpanPlanning();
> Having to release then reclaim the lock here is inconvenient, but seems nec
It is very inconvenient.
I dug into what it would take to update the code to reverse the lock order (where the 'ClientRequestState' lock was taken first followed by taking 'child_span_mu_'. My rationale for keeping it this way is because the StartChildSpan functions do not take the 'ClientRequestState' lock except in the case where another child span is already active. Cases where this situation happens should be few and far between. Also, the other EndChildSpan functions are not called from places where the 'ClientRequestState' lock is either held immediately preceding or immediately after the function call ('EndChildSpanAdmissionControl' in client-request-state.cc is the lone exception, but even moving that call down into the next code block would hold the 'ClientRequestState' lock unnecessarily during the 'StartChildSpanQueryExecution' function).
In the spirit of holding the 'ClientRequestState' lock for as little time as possible (https://github.com/apache/impala/blob/4628b18ad07ca9c6a86a6cd4e54b7b71ed76221e/be/src/service/client-request-state.h#L597-L601), it's better in this one place to reacquire the lock even though it was released in the previous line of code.
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 16:41:49 +0000
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 3:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/20489/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 3
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 20:34:29 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 1:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/20485/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 16:43:41 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Jason Fehr (Code Review)" <ge...@cloudera.org>.
Jason Fehr has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 3:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/service/impala-server.cc
File be/src/service/impala-server.cc:
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/service/impala-server.cc@1428
PS1, Line 1428: (*query_handle)->otel_span_manager()->EndChildSpanPlanning();
> Would it actually lead to a deadlock if one locked 'child_span_mu_' and did
It would not. There are places where child_span_mu_ is locked without also locking ClientRequestState->lock. The issue is that other code takes child_span_mu_ before it takes ClientRequestState->lock, and switching the order of that lock taking will result in a unnecessary locking of ClientRequestState->lock.
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 3
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 21:01:35 +0000
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 3: Verified+1
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 3
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Tue, 16 Sep 2025 01:42:55 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Jason Fehr (Code Review)" <ge...@cloudera.org>.
Hello Abhishek Rawat, Michael Smith, Impala Public Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/23422
to look at the new patch set (#2).
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
All functions in the SpanManager class operate under the assumption
that child_span_mu_ in the SpanManager class will be locked before
the ClientRequestState lock. However, the
ImpalaServer::ExecuteInternal function takes the ClientRequestState
lock before calling SpanManager::EndChildSpanPlanning. If another
function in the SpanManager class has already taken the
child_span_mu_ lock and is waiting for the ClientRequestState lock,
a deadlock occurs.
This issue was found by running end-to-end tests with OpenTelemetry
tracing enabled and a release buildof Impala.
Testing accomplished by re-running the end-to-end tests with
OpenTelemetry tracing enabled and verifying that the deadlock no
longer occurs.
Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
---
M be/src/observe/span-manager.cc
M be/src/observe/span-manager.h
M be/src/service/impala-server.cc
3 files changed, 5 insertions(+), 8 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/22/23422/2
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 2
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 3:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/service/impala-server.cc
File be/src/service/impala-server.cc:
http://gerrit.cloudera.org:8080/#/c/23422/1/be/src/service/impala-server.cc@1428
PS1, Line 1428: (*query_handle)->otel_span_manager()->EndChildSpanPlanning();
> It is very inconvenient.
Would it actually lead to a deadlock if one locked 'child_span_mu_' and did stuff (never taking 'ClientRequestState->lock'), and another took 'ClientRequestState-lock' and waited for 'child_span_mu_'?
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 3
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 20:24:39 +0000
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Jason Fehr (Code Review)" <ge...@cloudera.org>.
Jason Fehr has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 3:
> Patch Set 3: Code-Review+2
>
> This is an acceptable fix. I'm just exploring if there are ways to optimize it a bit.
I appreciate the questions!
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 3
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 23:11:58 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 2:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/20487/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 2
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 17:09:15 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 2
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 17:46:27 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Joe McDonnell (Code Review)" <ge...@cloudera.org>.
Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 2: Code-Review+1
Reworking the locking makes sense to me. I think we should have a comment somewhere that child_span_mu_ is before ClientRequestState's lock in the lock ordering. We could add a comment in span-manager.h. There is a list with the lock order in impala-server.h (which includes ClientRequestState's lock).
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 2
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 19:49:10 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
Posted by "Jason Fehr (Code Review)" <ge...@cloudera.org>.
Jason Fehr has posted comments on this change. ( http://gerrit.cloudera.org:8080/23422 )
Change subject: IMPALA-14433: Fix OpenTelemetry Tracing Deadlock
......................................................................
Patch Set 2:
> Patch Set 2: Code-Review+1
>
> Reworking the locking makes sense to me. I think we should have a comment somewhere that child_span_mu_ is before ClientRequestState's lock in the lock ordering. We could add a comment in span-manager.h. There is a list with the lock order in impala-server.h (which includes ClientRequestState's lock).
Good idea, added comment. Right now there are only two locks, but a following change will add a third, thus why there is a list even though only two locks are on that list.
--
To view, visit http://gerrit.cloudera.org:8080/23422
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b43dba794cfe61d283bdd476e4056b9304d8947
Gerrit-Change-Number: 23422
Gerrit-PatchSet: 2
Gerrit-Owner: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Comment-Date: Mon, 15 Sep 2025 20:08:23 +0000
Gerrit-HasComments: No