-
Notifications
You must be signed in to change notification settings - Fork 420
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
Two important fixes (and possibly more improvements) #188
Conversation
…would all GRPC call objects to never get released, which in turn caused their completion queues and associated file descriptors to never get released. This became apparent after ~3-5k requests on macOS.
Trying to re-run CI... |
…ue to the queue itself. This is needed because it appears that otherwise, the underlying completion queue gets deallocated during its spinloop, which it doesn't like.
Please don't merge this yet. I might have introduced new errors. |
Actually, I think it's fine ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These test changes reverts the critical check of statusCode
to mask an existing bug.
Tests/SwiftGRPCTests/GRPCTests.swift
Outdated
} | ||
|
||
// We need to return status OK in both cases, as it seems like the server might never send out the last few messages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a huge problem. We need to assert that the server sends an appropriate status code and if it's not currently then tests should be failing
Tests/SwiftGRPCTests/GRPCTests.swift
Outdated
@@ -157,23 +166,32 @@ func callUnary(channel: Channel) throws { | |||
try call.start(.unary, metadata: metadata, message: message) { | |||
response in | |||
// verify the basic response from the server | |||
XCTAssertEqual(response.statusCode, (i % 2 == 0) ? evenStatusCode : oddStatusCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means we never check for non .ok
status codes which was the original bug filed in #144.
The tests you provided regularly had "unexpected response" messages (which I converted into Also notice that we still have tests for this — it is now covered (and I'd say in a much cleaner way) by |
P.S.: I agree that we might want to raise the issue of the server not sending back all remaining messages when it is given a non-OK status to return with the gRPC-Core team. However, do keep in mind that this is now tested (with much less wrapping code that can cause unrelated flakes) in |
This doesn't make any sense. Servers regularly return non-OK statuses and continue to operate. I think this is a problem specific to the swift implementation. My concern is the haste in which these changes were made and the lack of debate over them. It doesn't inspire much faith in the project and quality users can expect from it. |
@cvanderschuere Thanks for submitting tests and raising your concerns. Please consider everything since our last tagged version tentative. |
FYI, I have filed grpc/grpc#14842 with the gRPC project to inquire about the issue with non-OK status codes. |
Received an update on grpc/grpc#14842 (comment), with a link to https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/grpc-io/OwZZq27awUQ/uNRL0_7ICQAJ:
So I think the server will need to keep returning |
Fixed two critical memory leaks in the C shim, as well as another flake in GRPCTests.