Jason Fehr has posted comments on this change. ( https://gerrit.cloudera.org/24502 )
Change subject: IMPALA-15107: Support Direct Thrift Upload for AI Profile Analyzer ...................................................................... Patch Set 9: (6 comments) https://gerrit.cloudera.org/#/c/24502/6/be/src/service/impala-http-handler.cc File be/src/service/impala-http-handler.cc: https://gerrit.cloudera.org/#/c/24502/6/be/src/service/impala-http-handler.cc@237 PS6, Line 237: MakeCallback(this, &ImpalaHttpHandler::QueryAiAnalysisHandler), false); : : // An uploaded thrift profile needs a larger POST body than the global limit allows. : webser > Done Done https://gerrit.cloudera.org/#/c/24502/6/be/src/service/query-profile-ai-analysis-test.cc File be/src/service/query-profile-ai-analysis-test.cc: https://gerrit.cloudera.org/#/c/24502/6/be/src/service/query-profile-ai-analysis-test.cc@145 PS6, Line 145: > Done Done https://gerrit.cloudera.org/#/c/24502/9/be/src/service/query-profile-ai-analysis.cc File be/src/service/query-profile-ai-analysis.cc: https://gerrit.cloudera.org/#/c/24502/9/be/src/service/query-profile-ai-analysis.cc@980 PS9, Line 980: if (process_tracker != nullptr) { : tracker.CloseAndUnregisterFromParent(); : } else { : tracker.Close(); : } This code doesn't seem quite right. tracker holds a pointer to the process level MemTracker. Closing it will close that tracker for everything. https://gerrit.cloudera.org/#/c/24502/9/be/src/service/query-profile-ai-analysis.cc@992 PS9, Line 992: const auto release_estimate = : MakeScopeExitTrigger([&]() { tracker.Release(mem_estimate); }); >From Opus: Memory accounting ends too early. The conversion reservation is released when ConvertThriftProfileArchiveToJson returns. The JSON document, usually the largest object, then lives untracked for the whole LLM call, which can take minutes. https://gerrit.cloudera.org/#/c/24502/9/be/src/service/query-profile-ai-analysis.cc@997 PS9, Line 997: RETURN_IF_ERROR(RuntimeProfile::CreateFromArchiveString( >From Opus: user provided input is passed without verification to this function >which, in turn, uses DCHECKS to do its validation. This approach allows >crashing the Impala coordinator. Suggested fixes: 1. Update `RuntimeProfile::CreateFromArchiveString` to return `Status` switching the DCHECKS to return a non-OK status. 2. Validate the user-provided `thrift_profile_archive` before passing it to `RuntimeProfile::CreateFromArchiveString`. https://gerrit.cloudera.org/#/c/24502/6/be/src/util/runtime-profile.h File be/src/util/runtime-profile.h: https://gerrit.cloudera.org/#/c/24502/6/be/src/util/runtime-profile.h@746 PS6, Line 746: static Status CreateFromArchiveString( : std::string_view archi > Done Done -- To view, visit https://gerrit.cloudera.org/24502 To unsubscribe, visit https://gerrit.cloudera.org/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iff05c3cde7b34a56e31f020611cc33ff4e02aa32 Gerrit-Change-Number: 24502 Gerrit-PatchSet: 9 Gerrit-Owner: Gokul Kolady <[email protected]> Gerrit-Reviewer: Abhishek Rawat <[email protected]> Gerrit-Reviewer: Anubhav Jindal <[email protected]> Gerrit-Reviewer: Gokul Kolady <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Jason Fehr <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Reviewer: Yida Wu <[email protected]> Gerrit-Comment-Date: Mon, 16 Nov 2026 16:30:07 +0000 Gerrit-HasComments: Yes
