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 2021/02/05 14:31:16 UTC

[GitHub] [nifi-minifi-cpp] martinzink opened a new pull request #994: MINIFICPP-1434: Fix flaky CSite2SiteTests on macOS

martinzink opened a new pull request #994:
URL: https://github.com/apache/nifi-minifi-cpp/pull/994


   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 main)?
   
   - [ ] 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 GitHub Actions CI results 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



[GitHub] [nifi-minifi-cpp] martinzink commented on a change in pull request #994: MINIFICPP-1434: Fix flaky CSite2SiteTests on macOS

Posted by GitBox <gi...@apache.org>.
martinzink commented on a change in pull request #994:
URL: https://github.com/apache/nifi-minifi-cpp/pull/994#discussion_r571136532



##########
File path: nanofi/tests/CSite2SiteTests.cpp
##########
@@ -166,8 +170,12 @@ void different_version_bootstrap(minifi::io::BaseStream* stream, TransferState&
   sunny_path_bootstrap(stream, transfer_state, s2s_data);
 }
 
+

Review comment:
       fixed




----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] martinzink commented on a change in pull request #994: MINIFICPP-1434: Fix flaky CSite2SiteTests on macOS

Posted by GitBox <gi...@apache.org>.
martinzink commented on a change in pull request #994:
URL: https://github.com/apache/nifi-minifi-cpp/pull/994#discussion_r572079690



##########
File path: nanofi/tests/CSite2SiteTests.cpp
##########
@@ -167,7 +173,9 @@ void different_version_bootstrap(minifi::io::BaseStream* stream, TransferState&
 }
 
 TEST_CASE("TestSiteToBootStrap", "[S2S3]") {
-
+#ifndef WIN32
+  signal(SIGPIPE, SIG_IGN);

Review comment:
       Sure, a SIGPIPE is sent to a process if it tried to write to a socket that had been shutdown for writing or isn't connected (anymore), this can easily happen in multithreaded enviroment. 
   The issue is that on macOS the default sigpipe handler crashes the application.
   In production code we are already ignoring this signal by setting the sigpipe handle to nothing. see https://github.com/apache/nifi-minifi-cpp/blob/main/main/MiNiFiMain.cpp#L181
   
   Given that in production code we are ignoring the signal, I think it would be best to ignore it here as well.
   
   I've tested this on my fork with custom CI, on both macos-xcode12.0 and macos-xcode11.2.1 with 200 runs
   `make test ARGS="--timeout 300 -j4 --output-on-failure -R CSite2SiteTests --repeat-until-fail 200`
   Without the fix both configuration failed (both around the 100th run), with the fix they passed 3 times (that's 1200 runs without failure)




----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #994: MINIFICPP-1434: Fix flaky CSite2SiteTests on macOS

Posted by GitBox <gi...@apache.org>.
arpadboda commented on a change in pull request #994:
URL: https://github.com/apache/nifi-minifi-cpp/pull/994#discussion_r572063095



##########
File path: nanofi/tests/CSite2SiteTests.cpp
##########
@@ -167,7 +173,9 @@ void different_version_bootstrap(minifi::io::BaseStream* stream, TransferState&
 }
 
 TEST_CASE("TestSiteToBootStrap", "[S2S3]") {
-
+#ifndef WIN32
+  signal(SIGPIPE, SIG_IGN);

Review comment:
       Could you elaborate how this fixes the issue?




----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] arpadboda closed pull request #994: MINIFICPP-1434: Fix flaky CSite2SiteTests on macOS

Posted by GitBox <gi...@apache.org>.
arpadboda closed pull request #994:
URL: https://github.com/apache/nifi-minifi-cpp/pull/994


   


----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] martinzink commented on a change in pull request #994: MINIFICPP-1434: Fix flaky CSite2SiteTests on macOS

Posted by GitBox <gi...@apache.org>.
martinzink commented on a change in pull request #994:
URL: https://github.com/apache/nifi-minifi-cpp/pull/994#discussion_r571136617



##########
File path: nanofi/tests/CSite2SiteTests.cpp
##########
@@ -17,6 +17,7 @@
  */
 
 #include <stdlib.h>
+#include <signal.h>

Review comment:
       fixed




----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] martinzink commented on pull request #994: MINIFICPP-1434: Fix flaky CSite2SiteTests on macOS

Posted by GitBox <gi...@apache.org>.
martinzink commented on pull request #994:
URL: https://github.com/apache/nifi-minifi-cpp/pull/994#issuecomment-774072591


   The issue is that on macOS the default sigpipe handler crashes the application.
   In production code we are already ignoring this by setting the sigpipe handle to nothing. see https://github.com/apache/nifi-minifi-cpp/blob/main/main/MiNiFiMain.cpp#L181
   Given this I think it would be appropriate to ignore it in these tests as well.
   
   I've tested this on my fork with custom CI, on both macos-xcode12.0 and macos-xcode11.2.1 with 200 runs
   `make test ARGS="--timeout 300 -j4 --output-on-failure -R CSite2SiteTests --repeat-until-fail 200`
   Without the fix both configuration failed (both around the 100th run), with the fix they passed 3 times (thats 1200 runs without failure)


----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #994: MINIFICPP-1434: Fix flaky CSite2SiteTests on macOS

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #994:
URL: https://github.com/apache/nifi-minifi-cpp/pull/994#discussion_r571080486



##########
File path: nanofi/tests/CSite2SiteTests.cpp
##########
@@ -166,8 +170,12 @@ void different_version_bootstrap(minifi::io::BaseStream* stream, TransferState&
   sunny_path_bootstrap(stream, transfer_state, s2s_data);
 }
 
+

Review comment:
       I don't think we need this empty line

##########
File path: nanofi/tests/CSite2SiteTests.cpp
##########
@@ -17,6 +17,7 @@
  */
 
 #include <stdlib.h>
+#include <signal.h>

Review comment:
       This should be wrapped in `#ifndef WIN32` as well




----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #994: MINIFICPP-1434: Fix flaky CSite2SiteTests on macOS

Posted by GitBox <gi...@apache.org>.
arpadboda commented on a change in pull request #994:
URL: https://github.com/apache/nifi-minifi-cpp/pull/994#discussion_r572108982



##########
File path: nanofi/tests/CSite2SiteTests.cpp
##########
@@ -167,7 +173,9 @@ void different_version_bootstrap(minifi::io::BaseStream* stream, TransferState&
 }
 
 TEST_CASE("TestSiteToBootStrap", "[S2S3]") {
-
+#ifndef WIN32
+  signal(SIGPIPE, SIG_IGN);

Review comment:
       Thanks for the details, makes sense!
   At least whoever finds this change lager, will see the reasoning here. 




----------------------------------------------------------------
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