-
Notifications
You must be signed in to change notification settings - Fork 242
deadlock fix proposals #121
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
Conversation
b768d6b to
586dbc1
Compare
bfe13ff to
918612a
Compare
|
I've added a TCP_NODELAY in the TCP transport layer as I think we want every packet to be send immediately. I've also set it in the server after the accept() and not on the main serverSocket b/c some stack do not inherit parameters (I'm not even sure this is a standard behavior) |
|
I saw the test failed on gcc/amd64/Linux but it's strange as all what is added is TCP_NODELAY and the build works, just the test fails (other OS/compilers seem to work). Could it be that now with TCP_NODELAY the response is coming to fast and the issue is in the test itself? Previously, the Nagle's algorithm was causing a fair bit of delay in TCP transport |
|
Let me know if more comments/explanations are needed |
|
It's really up to you. My changes include client & server TCP_NODELAY which was missing in the #33 patch. For #90, it's addressing the issue a bit differently. I've added a "full init" function that includes the "isServer" bool function as well as separated "configure" and "init" function. It does, I think, what #90 was aiming at. |
MichalPrincNXP
left a comment
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.
Hello @pgu-swir , @Hadatko ,
let we share my view about this PR. In general, I find this PR more "advanced" when comparing with #90 (no response from the author, focus on tcp setup only) and #33 (TCP_NODELAY socket flag focus only). To be honest I am not able to judge if this #121 also solves the MAC OS issue being discussed in #33, hope it does, @mentaal would you be able to test it on your side, please?
Additional minor notes:
- I have triggered Travis build on this PR again and it passed
- Internal testing passed too
- I am not sure about the amount of setup functions, to keep it clean for users I would provide just erpc_transport_tcp_init_full(), are the other func. really needed, is there a case when the user would need to perform each individual steps separately instead of calling just one erpc_transport_tcp_init_full() API?
- minor merge conflict in erpc_tcp_transport.cpp needs to be solved
- erpc_manually_constructed.h: I do not think this change is needed as there is no construct with 6 parameters, have I missed sth.?
I would tend to agree, I provided these initially thinking that one might want the open/close of the server (socket) without rebuilding a server or initializing without opening the socket immediately. But in my own example, I always do the init/configure/open = init_full alltogether, so I could rename the 'init_full' version to 'init' and just keep this one
I can do that, it's just that afaik, C++ allows initialization of struct with empty braces (C does not) so I usually do that to avoid a memset call. But I can revert that if you prefer
You're correct, it was it is for a different patch that I have ready now where eRPC is ported to another processor where I need these 6 parameters. I just put them as a provision |
Thank you, would you be able to rebase, solve the conflict and update the code as mentioned above till this Thursday? There is internal code freeze on Friday and I would like to have your PR being part of the next 1.8.0 release. Thanks a lot. |
Done - I had a 'moment' with some of the rebasing but the changes are the ones expected |
6198692 to
5431461
Compare
5431461 to
12815bf
Compare
|
@pgu-swir , thanks a lot for your effort! |
I have done a port on another platform and during that, I've made a few changes that you might be interested in.
I'll do another PR for the platform specifics