Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion src/python/examples/simple_grpc_model_control.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# Copyright 2020-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -100,6 +100,37 @@
print("FAILED : Unload Model")
sys.exit(1)

# Single path component longer than NAME_MAX must be rejected without
# terminating the server (invalid-arg response, not process abort).
long_path = "file:" + ("A" * 256)
Comment thread
yinggeh marked this conversation as resolved.
try:
triton_client.load_model(
model_name,
config="{}",
files={long_path: b"a"},
)
except InferenceServerException as e:
# TODO: [TRI-958] StatusCode.INVALID_ARGUMENT is more appropriate here
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed.

if e.status() != "StatusCode.INTERNAL":
print(
"FAILED: expected status 'StatusCode.INTERNAL' for oversized file parameter, "
"got status={!r}".format(e.status())
)
sys.exit(1)
if "failed to poll from model repository" not in e.message():
print(
"FAILED: expected 'failed to poll from model repository' for oversized file parameter, "
"got message={!r}".format(e.message())
)
sys.exit(1)
else:
print("FAILED: expected error for oversized file parameter")
sys.exit(1)

if not triton_client.is_server_live():
print("FAILED: server not live after rejected load")
sys.exit(1)

# Trying to load wrong model name should emit exception
try:
triton_client.load_model("wrong_model_name")
Expand Down
Loading