From 6fdf6a27b4303174f90d508210f7d4de194b4b42 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Thu, 16 Apr 2026 18:10:40 +0530 Subject: [PATCH 1/6] Update --- qa/L0_http/http_test.py | 28 ++++++++++++++++++++++++++++ qa/L0_http/test.sh | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/qa/L0_http/http_test.py b/qa/L0_http/http_test.py index 48ef1728f4..f554f81bc2 100755 --- a/qa/L0_http/http_test.py +++ b/qa/L0_http/http_test.py @@ -423,6 +423,34 @@ def create_nested_json(depth, value): except ValueError: self.fail("Response is not valid JSON") + def test_repository_index_deeply_nested_json(self): + """Test for deeply nested JSON on model repository index.""" + depth = 250000 + nested = ("[" * depth) + "true" + ("]" * depth) + payload = '{"ready":' + nested + "}" + + # Keep request below default --http-max-input-size so parsing path is exercised. + self.assertLess(len(payload), 64 * 1024 * 1024) + + response = requests.post( + "http://localhost:8000/v2/repository/index", + data=payload, + headers={"Content-Type": "application/json"}, + timeout=60, + ) + self.assertNotEqual( + 500, + response.status_code, + "Expected repository index request to fail on invalid 'ready' type.", + ) + + live_response = requests.get("http://localhost:8000/v2/health/live", timeout=10) + self.assertEqual( + 200, + live_response.status_code, + "Expected server to remain live after deeply nested JSON request.", + ) + if __name__ == "__main__": unittest.main() diff --git a/qa/L0_http/test.sh b/qa/L0_http/test.sh index 8d6944dbdd..c155087ae6 100755 --- a/qa/L0_http/test.sh +++ b/qa/L0_http/test.sh @@ -672,7 +672,7 @@ fi TEST_RESULT_FILE='test_results.txt' PYTHON_TEST=http_test.py -EXPECTED_NUM_TESTS=13 +EXPECTED_NUM_TESTS=14 set +e python $PYTHON_TEST >$CLIENT_LOG 2>&1 if [ $? -ne 0 ]; then From f9a645b4343afd982db9eb6b021e9fc264bd7301 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Fri, 17 Apr 2026 10:47:51 +0530 Subject: [PATCH 2/6] Update --- qa/L0_http/http_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/L0_http/http_test.py b/qa/L0_http/http_test.py index f554f81bc2..08d9257c80 100755 --- a/qa/L0_http/http_test.py +++ b/qa/L0_http/http_test.py @@ -438,7 +438,7 @@ def test_repository_index_deeply_nested_json(self): headers={"Content-Type": "application/json"}, timeout=60, ) - self.assertNotEqual( + self.assertEqual( 500, response.status_code, "Expected repository index request to fail on invalid 'ready' type.", From 38e4c165df4337c7a39bdbb0b00dec6473178e08 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Mon, 20 Apr 2026 18:06:09 +0530 Subject: [PATCH 3/6] Update --- qa/L0_http/http_test.py | 7 ++++++- src/http_server.cc | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/qa/L0_http/http_test.py b/qa/L0_http/http_test.py index 08d9257c80..734382aed4 100755 --- a/qa/L0_http/http_test.py +++ b/qa/L0_http/http_test.py @@ -439,10 +439,15 @@ def test_repository_index_deeply_nested_json(self): timeout=60, ) self.assertEqual( - 500, + 400, response.status_code, "Expected repository index request to fail on invalid 'ready' type.", ) + self.assertIn("error", response.json()) + self.assertIn( + "Invalid value for 'ready': expected a boolean", + response.json()["error"], + ) live_response = requests.get("http://localhost:8000/v2/health/live", timeout=10) self.assertEqual( diff --git a/src/http_server.cc b/src/http_server.cc index 765cfde64b..5cce136ede 100644 --- a/src/http_server.cc +++ b/src/http_server.cc @@ -1413,7 +1413,13 @@ HTTPAPIServer::HandleRepositoryIndex( if (buffer_len > 0) { triton::common::TritonJson::Value ready_json; if (index_request.Find("ready", &ready_json)) { - err = ready_json.AsBool(&ready); + if (!ready_json.IsBool()) { + err = TRITONSERVER_ErrorNew( + TRITONSERVER_ERROR_INVALID_ARG, + "Invalid value for 'ready': expected a boolean"); + } else { + err = ready_json.AsBool(&ready); + } } } From 89b5b37b164798b901a5555f45cdf61f398ad318 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Wed, 22 Apr 2026 11:27:28 +0530 Subject: [PATCH 4/6] Update --- qa/L0_http/http_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/qa/L0_http/http_test.py b/qa/L0_http/http_test.py index 734382aed4..4ee299205e 100755 --- a/qa/L0_http/http_test.py +++ b/qa/L0_http/http_test.py @@ -443,7 +443,6 @@ def test_repository_index_deeply_nested_json(self): response.status_code, "Expected repository index request to fail on invalid 'ready' type.", ) - self.assertIn("error", response.json()) self.assertIn( "Invalid value for 'ready': expected a boolean", response.json()["error"], From a42c40c714281267b8e536f02f171f68a0798653 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Thu, 23 Apr 2026 19:42:57 +0530 Subject: [PATCH 5/6] Update --- qa/L0_http/http_test.py | 32 ++++++++++++++++++++++++++++++++ qa/L0_http/test.sh | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/qa/L0_http/http_test.py b/qa/L0_http/http_test.py index 2ce2ea25c3..9ea65fddf6 100755 --- a/qa/L0_http/http_test.py +++ b/qa/L0_http/http_test.py @@ -499,6 +499,38 @@ def test_duplicate_output_names(self): "Server is not healthy after duplicate output request", ) + def test_repository_index_deeply_nested_json(self): + """Test for deeply nested JSON on model repository index.""" + depth = 250000 + nested = ("[" * depth) + "true" + ("]" * depth) + payload = '{"ready":' + nested + "}" + + # Keep request below default --http-max-input-size so parsing path is exercised. + self.assertLess(len(payload), 64 * 1024 * 1024) + + response = requests.post( + "http://localhost:8000/v2/repository/index", + data=payload, + headers={"Content-Type": "application/json"}, + timeout=60, + ) + self.assertEqual( + 400, + response.status_code, + "Expected repository index request to fail on invalid 'ready' type.", + ) + self.assertIn( + "Invalid value for 'ready': expected a boolean", + response.json()["error"], + ) + + live_response = requests.get("http://localhost:8000/v2/health/live", timeout=10) + self.assertEqual( + 200, + live_response.status_code, + "Expected server to remain live after deeply nested JSON request.", + ) + if __name__ == "__main__": unittest.main() diff --git a/qa/L0_http/test.sh b/qa/L0_http/test.sh index bfe7a94b46..e11cbde38b 100755 --- a/qa/L0_http/test.sh +++ b/qa/L0_http/test.sh @@ -672,7 +672,7 @@ fi TEST_RESULT_FILE='test_results.txt' PYTHON_TEST=http_test.py -EXPECTED_NUM_TESTS=15 +EXPECTED_NUM_TESTS=16 set +e python $PYTHON_TEST >$CLIENT_LOG 2>&1 if [ $? -ne 0 ]; then From 8bd16b2f4d223d3d705fc4dd4a05189cf3c0349b Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Fri, 24 Apr 2026 10:40:20 +0530 Subject: [PATCH 6/6] Fix L0_cuda_shared_memeory --- qa/L0_cuda_shared_memory/cuda_shared_memory_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/L0_cuda_shared_memory/cuda_shared_memory_test.py b/qa/L0_cuda_shared_memory/cuda_shared_memory_test.py index f629fa6b16..12ade110f0 100755 --- a/qa/L0_cuda_shared_memory/cuda_shared_memory_test.py +++ b/qa/L0_cuda_shared_memory/cuda_shared_memory_test.py @@ -760,7 +760,7 @@ def test_exceeds_cshm_handle_size_limit(self): error_message, ) self.assertIn( - "exceeds the maximum allowed value", + "exceeds the maximum allowed input size", error_message, ) except ValueError: