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/04/24 12:25:14 UTC

[GitHub] [nifi] Woutifier opened a new pull request #4233: NIFI-7393: add max idle time and max idle connections parameter to In…

Woutifier opened a new pull request #4233:
URL: https://github.com/apache/nifi/pull/4233


   …vokeHTTP
   
   Thank you for submitting a contribution to Apache NiFi.
   
   Please provide a short description of the PR here:
   
   #### Expose connectionPool parameters to Nifi
   
   Adds max idle time and max idle connections parameters to InvokeHTTP;  fixes NIFI-7393
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [x] Is there a JIRA ticket associated with this PR? Is it referenced 
        in the commit message?
   
   - [x] Does your PR title start with **NIFI-XXXX** where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [x] Has your PR been rebased against the latest commit within the target branch (typically `master`)?
   
   - [x] Is your initial contribution a single, squashed commit? _Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not `squash` or use `--force` when pushing to allow for clean monitoring of changes._
   
   ### For code changes:
   - [ ] Have you ensured that the full suite of tests is executed via `mvn -Pcontrib-check clean install` at the root `nifi` folder?
   - [ ] Have you written or updated unit tests to verify your changes?
   - [ ] Have you verified that the full build is successful on both JDK 8 and JDK 11?
   - [ ] 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, including the main `LICENSE` file under `nifi-assembly`?
   - [ ] If applicable, have you updated the `NOTICE` file, including the main `NOTICE` file found under `nifi-assembly`?
   - [ ] If adding new Properties, have you added `.displayName` in addition to .name (programmatic access) for each of the new properties?
   
   ### 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



[GitHub] [nifi] Woutifier commented on pull request #4233: NIFI-7393: add max idle time and max idle connections parameter to InvokeHTTP

Posted by GitBox <gi...@apache.org>.
Woutifier commented on pull request #4233:
URL: https://github.com/apache/nifi/pull/4233#issuecomment-633860926


   > @Woutifier Other than my comment on validating that the time period is > 0 the code looks good. Is there an easy way to test this (not necessarily a unit test)?
   
   Hey @jfrazee thanks for your review. I'll add the >0 check. I'll see if I can come up with some way to verify that this actually does something (I did test it locally against one of our servers but would be nice to have a small test scenario).


----------------------------------------------------------------
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] jfrazee commented on pull request #4233: NIFI-7393: add max idle time and max idle connections parameter to InvokeHTTP

Posted by GitBox <gi...@apache.org>.
jfrazee commented on pull request #4233:
URL: https://github.com/apache/nifi/pull/4233#issuecomment-632336433


   @Woutifier Other than my comment on validating that the time period is > 0 the code looks good. Is there an easy way to test this (not necessarily a unit test)?


----------------------------------------------------------------
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] jfrazee commented on pull request #4233: NIFI-7393: add max idle time and max idle connections parameter to InvokeHTTP

Posted by GitBox <gi...@apache.org>.
jfrazee commented on pull request #4233:
URL: https://github.com/apache/nifi/pull/4233#issuecomment-637663394


   @Woutifier I was able to test this by watching the stats given by the NGINX stub_status module. I can confirm that the Max Idle will cap the number of waiting connections to the expected number and that the Idle Timeout indeed controls how long those are kept alive after stopping InvokeHTTP.


----------------------------------------------------------------
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] Woutifier commented on pull request #4233: NIFI-7393: add max idle time and max idle connections parameter to InvokeHTTP

Posted by GitBox <gi...@apache.org>.
Woutifier commented on pull request #4233:
URL: https://github.com/apache/nifi/pull/4233#issuecomment-639291527


   That's no problem, I just went with what the other properties had for consistency.


----------------------------------------------------------------
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] jfrazee commented on a change in pull request #4233: NIFI-7393: add max idle time and max idle connections parameter to InvokeHTTP

Posted by GitBox <gi...@apache.org>.
jfrazee commented on a change in pull request #4233:
URL: https://github.com/apache/nifi/pull/4233#discussion_r428903445



##########
File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
##########
@@ -214,6 +215,22 @@
             .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR)
             .build();
 
+    public static final PropertyDescriptor PROP_IDLE_TIMEOUT = new PropertyDescriptor.Builder()
+            .name("Idle Timeout")
+            .description("Max idle time before closing connection to the remote service.")
+            .required(true)
+            .defaultValue("5 mins")
+            .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR)

Review comment:
       I think this needs to validate that it's > 0. OkHttp appears to, but it'd probably be nice if it got caught beforehand; see https://github.com/square/okhttp/blob/cfdeb570c211f83cef23c00afb18fe87c1a292f2/okhttp/src/main/kotlin/okhttp3/internal/connection/RealConnectionPool.kt#L49-L52
   
   You can use `StandardValidators.createTimePeriodValidator()` with a minimum of 1 sec or something.
   
   




----------------------------------------------------------------
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] Woutifier commented on pull request #4233: NIFI-7393: add max idle time and max idle connections parameter to InvokeHTTP

Posted by GitBox <gi...@apache.org>.
Woutifier commented on pull request #4233:
URL: https://github.com/apache/nifi/pull/4233#issuecomment-638261984


   Nice, what steps do you think we (I?) need to take to get this 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



[GitHub] [nifi] jfrazee commented on pull request #4233: NIFI-7393: add max idle time and max idle connections parameter to InvokeHTTP

Posted by GitBox <gi...@apache.org>.
jfrazee commented on pull request #4233:
URL: https://github.com/apache/nifi/pull/4233#issuecomment-639056744


   @Woutifier We'll be good to go after that little `name()` / `displayName()`.


----------------------------------------------------------------
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] jfrazee commented on a change in pull request #4233: NIFI-7393: add max idle time and max idle connections parameter to InvokeHTTP

Posted by GitBox <gi...@apache.org>.
jfrazee commented on a change in pull request #4233:
URL: https://github.com/apache/nifi/pull/4233#discussion_r435485319



##########
File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
##########
@@ -214,6 +215,22 @@
             .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR)
             .build();
 
+    public static final PropertyDescriptor PROP_IDLE_TIMEOUT = new PropertyDescriptor.Builder()
+            .name("Idle Timeout")

Review comment:
       I missed this. But can you change this to `.displayName("Idle Timeout")` and add `.name("idle-timeout")`? Similar for the other property. I know the older props didn't do this, but it's good to do for newer ones. If you can't get to it, I can maybe do it on merge since it's a tiny 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



[GitHub] [nifi] jfrazee closed pull request #4233: NIFI-7393: add max idle time and max idle connections parameter to InvokeHTTP

Posted by GitBox <gi...@apache.org>.
jfrazee closed pull request #4233:
URL: https://github.com/apache/nifi/pull/4233


   


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