Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for input shape #3158

Merged
merged 8 commits into from
Jul 29, 2021
Merged

Add check for input shape #3158

merged 8 commits into from
Jul 29, 2021

Conversation

krishung5
Copy link
Contributor

Should fix the issue #3119

@krishung5 krishung5 linked an issue Jul 27, 2021 that may be closed by this pull request
@krishung5 krishung5 requested a review from CoderHam July 27, 2021 18:19
@krishung5 krishung5 changed the title Add checking for input shape Add check for input shape Jul 27, 2021
src/servers/http_server.cc Outdated Show resolved Hide resolved
src/servers/http_server.cc Outdated Show resolved Hide resolved
src/servers/http_server.cc Outdated Show resolved Hide resolved
src/servers/http_server.cc Outdated Show resolved Hide resolved
src/servers/http_server.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@GuanLuo GuanLuo left a comment

Choose a reason for hiding this comment

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

Is the issue due to the content in "data" field misaligns with the "shape" field of the input? If so, it seems to be the same issue that this FIXME refers to. I think it is better to have a explicit check instead of what is suggested in the FIXME, but you should clean up the FIXME and related section as your change will address them.

src/servers/http_server.cc Outdated Show resolved Hide resolved
src/servers/http_server.cc Outdated Show resolved Hide resolved
src/servers/http_server.cc Outdated Show resolved Hide resolved
@krishung5 krishung5 force-pushed the krish-check-input-shape branch 2 times, most recently from 1afa59b to de4af8a Compare July 28, 2021 00:40
src/servers/http_server.cc Outdated Show resolved Hide resolved
src/servers/http_server.cc Outdated Show resolved Hide resolved
@krishung5 krishung5 requested a review from GuanLuo July 28, 2021 16:46
Copy link
Contributor

@GuanLuo GuanLuo left a comment

Choose a reason for hiding this comment

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

Otherwise looks good except for one more change. And @NonStatic2014 raised a point that we should add test coverage, testing with invalid request JSON, around it. You can add it to this PR or open a follow-up PR for that

src/servers/http_server.cc Outdated Show resolved Hide resolved
GuanLuo
GuanLuo previously approved these changes Jul 28, 2021
@@ -367,6 +367,34 @@ if [ `grep -c "\[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\]" ./curl.out` != "1" ]; then
RET=1
fi

# send bad request with invalid json
Copy link
Contributor

Choose a reason for hiding this comment

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

The json itself is not invalid. Fix:
Send bad request where the 'data' field misaligns with the 'shape' field of the input

qa/L0_http/test.sh Show resolved Hide resolved
"Unable to parse 'data'");
break;
}
// Check if 'ReadDataFromJsonHelper' reads
Copy link
Contributor

Choose a reason for hiding this comment

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

Run formatter

Copy link
Contributor

Choose a reason for hiding this comment

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

Also add empty line before this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

Copy link
Contributor

@CoderHam CoderHam left a comment

Choose a reason for hiding this comment

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

Minor formatting else LGTM

qa/L0_http/test.sh Show resolved Hide resolved
qa/L0_http/test.sh Show resolved Hide resolved
@krishung5 krishung5 merged commit f2974b2 into main Jul 29, 2021
@krishung5 krishung5 deleted the krish-check-input-shape branch July 29, 2021 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Triton server crashes silently with invalid input data
4 participants