You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/02/06 16:00:12 UTC

[GitHub] [nifi-minifi-cpp] szaszm opened a new pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime

szaszm opened a new pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime
URL: https://github.com/apache/nifi-minifi-cpp/pull/727
 
 
   Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced
        in the commit message?
   
   - [ ] Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically master)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   ### For code changes:
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the LICENSE file?
   - [ ] If applicable, have you updated the NOTICE file?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-minifi-cpp] arpadboda commented on issue #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime

Posted by GitBox <gi...@apache.org>.
arpadboda commented on issue #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime
URL: https://github.com/apache/nifi-minifi-cpp/pull/727#issuecomment-583156912
 
 
   Nice catch!
   
   Please fix the linter errors:
   ```
   /Users/travis/build/apache/nifi-minifi-cpp/libminifi/src//io/win/ClientSocket.cpp:41:  Do not indent within a namespace  [runtime/indentation_namespace] [4]
   /Users/travis/build/apache/nifi-minifi-cpp/libminifi/src//io/win/ClientSocket.cpp:46:  Anonymous namespace should be terminated with "// namespace"  [readability/namespace] [5]
   ```
   
   Otherwise I'm happy with this. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime
URL: https://github.com/apache/nifi-minifi-cpp/pull/727#discussion_r376000406
 
 

 ##########
 File path: libminifi/src/io/win/ClientSocket.cpp
 ##########
 @@ -242,11 +237,17 @@ int16_t Socket::initialize() {
   hints.ai_protocol = 0; /* any protocol */
 
   int errcode = getaddrinfo(requested_hostname_.c_str(), 0, &hints, &addr_info_);
 
 Review comment:
   done in ab3c3b4. Please excuse my confusion while writing the previous comment

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-minifi-cpp] szaszm commented on issue #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime

Posted by GitBox <gi...@apache.org>.
szaszm commented on issue #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime
URL: https://github.com/apache/nifi-minifi-cpp/pull/727#issuecomment-582976390
 
 
   With this change, SocketTests will no longer randomly fail on Windows and minifi will no longer randomly crash when a ClientSocket-based connection repeatedly fails.
   I'd prefer to handle other problems with the class after this and MINIFICPP-1119 (#713) are merged.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime
URL: https://github.com/apache/nifi-minifi-cpp/pull/727#discussion_r375928102
 
 

 ##########
 File path: libminifi/src/io/win/ClientSocket.cpp
 ##########
 @@ -242,11 +237,17 @@ int16_t Socket::initialize() {
   hints.ai_protocol = 0; /* any protocol */
 
   int errcode = getaddrinfo(requested_hostname_.c_str(), 0, &hints, &addr_info_);
 
 Review comment:
   The lifetime of `addr_info_` was changed from "from initialization to either the first failing `connect` or the end of `this`" to "during initialization".

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime
URL: https://github.com/apache/nifi-minifi-cpp/pull/727#discussion_r375947710
 
 

 ##########
 File path: libminifi/src/io/win/ClientSocket.cpp
 ##########
 @@ -242,11 +237,17 @@ int16_t Socket::initialize() {
   hints.ai_protocol = 0; /* any protocol */
 
   int errcode = getaddrinfo(requested_hostname_.c_str(), 0, &hints, &addr_info_);
 
 Review comment:
   The value is accessed by `createConnection` as a data member and I didn't want to risk breaking anything during this bugfix by changing the signature to take an additional argument.
   
   I'd prefer to later rewrite the whole class, that will most likely eliminate the need to pass the result of `getaddrinfo` to the function.
   
   I can do additional investigation about the required effort if you insist on this change.
   
   EDIT: I was wrong about the dependency. I'll see if I can make it a local variable.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime
URL: https://github.com/apache/nifi-minifi-cpp/pull/727#discussion_r376000406
 
 

 ##########
 File path: libminifi/src/io/win/ClientSocket.cpp
 ##########
 @@ -242,11 +237,17 @@ int16_t Socket::initialize() {
   hints.ai_protocol = 0; /* any protocol */
 
   int errcode = getaddrinfo(requested_hostname_.c_str(), 0, &hints, &addr_info_);
 
 Review comment:
   done in 6512bec. Please excuse my confusion while writing the previous comment

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime
URL: https://github.com/apache/nifi-minifi-cpp/pull/727#discussion_r375947710
 
 

 ##########
 File path: libminifi/src/io/win/ClientSocket.cpp
 ##########
 @@ -242,11 +237,17 @@ int16_t Socket::initialize() {
   hints.ai_protocol = 0; /* any protocol */
 
   int errcode = getaddrinfo(requested_hostname_.c_str(), 0, &hints, &addr_info_);
 
 Review comment:
   The value is accessed by `createConnection` as a data member and I didn't want to risk breaking anything during this bugfix by changing the signature to take an additional argument.
   
   I'd prefer to later rewrite the whole class, that will most likely eliminate the need to pass the result of `getaddrinfo` to the function.
   
   I can do additional investigation about the required effort if you insist on this change.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime

Posted by GitBox <gi...@apache.org>.
arpadboda commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime
URL: https://github.com/apache/nifi-minifi-cpp/pull/727#discussion_r375939226
 
 

 ##########
 File path: libminifi/src/io/win/ClientSocket.cpp
 ##########
 @@ -242,11 +237,17 @@ int16_t Socket::initialize() {
   hints.ai_protocol = 0; /* any protocol */
 
   int errcode = getaddrinfo(requested_hostname_.c_str(), 0, &hints, &addr_info_);
 
 Review comment:
   That's great, but in that case I think it just needs to be a local variable and not a member. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-minifi-cpp] arpadboda closed pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime

Posted by GitBox <gi...@apache.org>.
arpadboda closed pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime
URL: https://github.com/apache/nifi-minifi-cpp/pull/727
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #727: MINIFICPP-1148 ClientSocket: fix addrinfo lifetime
URL: https://github.com/apache/nifi-minifi-cpp/pull/727#discussion_r375928102
 
 

 ##########
 File path: libminifi/src/io/win/ClientSocket.cpp
 ##########
 @@ -242,11 +237,17 @@ int16_t Socket::initialize() {
   hints.ai_protocol = 0; /* any protocol */
 
   int errcode = getaddrinfo(requested_hostname_.c_str(), 0, &hints, &addr_info_);
 
 Review comment:
   The lifetime of `addr_info_` was changed from "from initialization until either the first failing `connect` or the end of `this`" to "during initialization".

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services