[ 
https://issues.apache.org/jira/browse/NIFI-1865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15278474#comment-15278474
 ] 

ASF GitHub Bot commented on NIFI-1865:
--------------------------------------

Github user mattyb149 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/429#discussion_r62712326
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPostHTTP.java
 ---
    @@ -407,4 +407,31 @@ public void testSendChunked() throws Exception {
             Assert.assertNull(lastPostHeaders.get("Content-Length"));
             
Assert.assertEquals("chunked",lastPostHeaders.get("Transfer-Encoding"));
         }
    +
    +    @Test
    +    public void testSendWithThrottler() throws Exception {
    +        setup(null);
    +
    +        final String suppliedMimeType = "text/plain";
    +        runner.setProperty(PostHTTP.URL, server.getUrl());
    +        runner.setProperty(PostHTTP.CONTENT_TYPE, suppliedMimeType);
    +        runner.setProperty(PostHTTP.CHUNKED_ENCODING, "false");
    +        runner.setProperty(PostHTTP.MAX_DATA_RATE, "10kb");
    +
    +        final Map<String, String> attrs = new HashMap<>();
    +        attrs.put(CoreAttributes.MIME_TYPE.key(), "text/plain");
    +
    +        runner.enqueue(StringUtils.repeat("This is the song that never 
ends. It goes on and on my friend.", 100).getBytes(), attrs);
    --- End diff --
    
    These song lyrics are copyrighted :-/ Need to replace with some other 
generic sample text


> PostHTTP and ListenHTTP never shutdown LeakyBucketStreamThrottler thread
> ------------------------------------------------------------------------
>
>                 Key: NIFI-1865
>                 URL: https://issues.apache.org/jira/browse/NIFI-1865
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 0.4.1
>            Reporter: Koji Kawamura
>            Assignee: Koji Kawamura
>            Priority: Minor
>
> LeakyBucketStreamThrottler implements close and inside it it shutdowns 
> executorService.
> However, ListenHTTP and PostHTTP doesn't call close, and since those 
> processors create new LeakyBucketStreamThrottler instance when it is 
> scheduled, it creates new thread without closing the old ones.
> It can be reproduced by repeating stop and start those processors again and 
> again. You can confirm the number of threads are increasing by following 
> command:
> {code}
> $ watch "ps -M |grep {nifi pid} | wc -l"
> {code}
> or using thread dump
> {code}
> $ tail -f logs/nifi-bootstrap.log |grep LeakyBucketStreamThrottler.java
> from another terminal
> $ kill -3 {nifi pid}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to