-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Make grpc_tcp_listener private. #4680
Conversation
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
The Windows code needs a Windows machine, unfortunately (as does some of the Mac code). Build results are here: Review status: 0 of 9 files reviewed at latest revision, 6 unresolved discussions, some commit checks failed. src/core/iomgr/tcp_server.h, line 44 [r1] (raw file): Let's bundle from_server, port_index, fd_index into a struct perhaps? src/core/iomgr/tcp_server.h, line 73 [r1] (raw file): src/core/iomgr/tcp_server.h, line 79 [r1] (raw file): src/core/iomgr/tcp_server.h, line 86 [r1] (raw file): Either it's always passed into the construction function, or it's always passed into the shutdown function. The previous API would work if grpc_tcp_server_destroy were renamed grpc_tcp_server_shutdown and released an implicit ref to the server. src/core/iomgr/tcp_server_posix.c, line 215 [r1] (raw file): https://github.com/grpc/grpc/blob/master/doc/c-style-guide.md src/core/iomgr/tcp_server_posix.c, line 366 [r1] (raw file): Comments from the review on Reviewable.io |
It looks like my best option to is check those Jenkins logs after I push. Review status: 0 of 9 files reviewed at latest revision, 6 unresolved discussions, some commit checks failed. src/core/iomgr/tcp_server.h, line 44 [r1] (raw file): src/core/iomgr/tcp_server.h, line 73 [r1] (raw file): src/core/iomgr/tcp_server.h, line 79 [r1] (raw file): src/core/iomgr/tcp_server.h, line 86 [r1] (raw file): I made it so it can only be passed to create(). src/core/iomgr/tcp_server_posix.c, line 215 [r1] (raw file): src/core/iomgr/tcp_server_posix.c, line 366 [r1] (raw file): Comments from the review on Reviewable.io |
Use grpc_shutdown() instead of grpc_iomgr_shutdown() to prevent grpc_pick_unused_port_or_die() from inappropriately destroying global state. Fix port allocation issues.
The only thing left that might be a test failure is tests.bins/asan/generic_async_streaming_ping_pong_test, but this is unlikely to be related to my code. It looks like a pre-existing test failure. |
tcp_server_posix_test illustrates how this can be used to implement a weak referencing mechanism.
There were some conflicts with master, so I did the merge. Craig, want to take a look at this and #4745 ? |
@ctiller, is there something this PR or should we merge it? Thanks! |
Hey - we've had some testing infrastructure madness the past week. Let me On Mon, Jan 25, 2016 at 10:00 AM jboeuf notifications@github.com wrote:
|
Awesome. thanks! |
Make grpc_tcp_listener private.
grpc_tcp_listener is now completely private to the implementation. It seems its
only use was to return the port, so add_port() now returns this instead.
Made the port_index stable: adding more ports doesn't affect the indices of
existing ports. (Previously, every add_port() would should shift them all by
one.)
grpc_tcp_server is now refcounted.
grpc_tcp_server_cb passes a pointer to the server and gives the callee a ref. It
also gives the indices of the accepting server fd.
I wasn't able to test (or even compile) any of the windows code. It looks like
some combination of docker, run_tests.py, and Jenkins would do this, but I was
wondering if there is a recommended way for a Linux user.
Based on discussion in #4555