Gokul Kolady 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 10: (4 comments) Fixed the compilation issue Yida pointed out. 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: static RuntimeProfileBase::Verbosity DefaultVerbosityForProfile( : const RuntimeProfile& profile) { : const RuntimeProfile* exec_profile = : dynamic_cast<const RuntimeProfile*>(profile.GetChildByPrefix("Execution Profile")); : if > This code doesn't seem quite right. tracker holds a pointer to the process Close() only closes the tracker it's called on, so the process tracker was never affected — but I've dropped that per-call tracker anyway: the reservation now lives on AiAnalysisSlot, which owns a child tracker and deregisters just that one on destruction. https://gerrit.cloudera.org/#/c/24502/9/be/src/service/query-profile-ai-analysis.cc@992 PS9, Line 992: // to, saturating instead of overflowing. : static int64_t MaxDecompressedUploadSize(int64_t archive_size) { > From Opus: The reservation is now held by AiAnalysisSlot, which the handler keeps for the whole request, so the JSON document stays accounted for through the LLM call. https://gerrit.cloudera.org/#/c/24502/9/be/src/service/query-profile-ai-analysis.cc@997 PS9, Line 997: } > From Opus: user provided input is passed without verification to this funct Added validation at the untrusted entry point: CreateFromArchiveString takes a RuntimeProfile::ArchiveLimits whose validate flag (set only by the upload path) checks the tree against the invariants that were DCHECK-only and it now errors instead of returning a null profile. https://gerrit.cloudera.org/#/c/24502/9/be/src/util/runtime-profile-archive.cc File be/src/util/runtime-profile-archive.cc: https://gerrit.cloudera.org/#/c/24502/9/be/src/util/runtime-profile-archive.cc@109 PS9, Line 109: } > Opus is reporting a decompression bomb causes an unbounded allocation of me DecompressToThrift now stops at limits.max_decompressed_size (upload path: 50× the upload by default, via --query_profile_ai_analysis_max_upload_expansion_ratio) and reserves memory from the caller's tracker before each buffer growth, so a bomb fails with MEM_LIMIT_EXCEEDED/503 rather than allocating. -- 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: 10 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: Wed, 18 Nov 2026 21:15:25 +0000 Gerrit-HasComments: Yes
