[
https://issues.apache.org/jira/browse/NIFI-4959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16398756#comment-16398756
]
ASF GitHub Bot commented on NIFI-4959:
--------------------------------------
GitHub user mgaido91 opened a pull request:
https://github.com/apache/nifi/pull/2544
NIFI-4959: Remove flowfiles and close connection for Bad Requests causing
IOException
Thank you for submitting a contribution to Apache NiFi.
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?
### For code changes:
- [x] 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? Tested
manually
- [ ] 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)? NA
- [ ] If applicable, have you updated the LICENSE file, including the main
LICENSE file under nifi-assembly? NA
- [ ] If applicable, have you updated the NOTICE file, including the main
NOTICE file found under nifi-assembly? NA
- [ ] If adding new Properties, have you added .displayName in addition to
.name (programmatic access) for each of the new properties? NA
### 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.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mgaido91/nifi NIFI-4959
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/2544.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2544
----
commit 15f0a04a1b2b4600ccf2b43b83f0ec157dbfd500
Author: Marco Gaido <marcogaido91@...>
Date: 2018-03-14T15:27:17Z
NIFI-4959: Remove flowfiles and close connection for Bad Requests causing
IOException
----
> HandleHttpRequest processor doesn't close/release incomplete message error
> --------------------------------------------------------------------------
>
> Key: NIFI-4959
> URL: https://issues.apache.org/jira/browse/NIFI-4959
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.5.0, 1.6.0
> Environment: Linux, all versions of nifi-1.X
> Reporter: Wynner
> Priority: Major
>
> I am doing some testing with the HandleHttpRequest processor. My specific
> test, involves sending an incomplete request and closing the connection from
> the sending system. Initially, it throws the error I expect, but it keeps
> throwing the error over and over based on the request expiration configured
> in the StandardHttpContextMap controller service.
> The only way to stop the error message is to stop the processor. In my test,
> I saw one failed request throw an error six times before I stopped the
> processor.
> It doesn't seems to terminate the request on the NiFi side.
> Sample HTTP request
>
> POST/ HTTP/ 1.1
> Host: foo.com
> Content-Type: text/plain
> Content-Length: 130
> say=Hi&to-Mom
>
> I use the telnet command to connect to the system with the processor
> listening, post the message above , close the connection, and then the
> processor starts throws the following error indefinitely
> 2018-03-10 01:36:37,111 ERROR [Timer-Driven Process Thread-6]
> o.a.n.p.standard.HandleHttpRequest
> HandleHttpRequest[id=0d8547f7-0162-1000-9b84-129af2382259]
> HandleHttpRequest[id=0d8547f7-0162-1000-9b84-129af2382259] failed to process
> session due to org.apache.nifi.processor.exception.FlowFileAccessException:
> Failed to import data from
> HttpInputOverHTTP@46e7d12e[c=15,q=0,[0]=null,s=EARLY_EOF] for
> StandardFlowFileRecord[uuid=32bb182d-f619-4b98-b6f8-c1ed50c2736a,claim=,offset=0,name=9714775822613527,size=0]
> due to org.apache.nifi.processor.exception.FlowFileAccessException: Unable
> to create ContentClaim due to org.eclipse.jetty.io.EofException: Early EOF: {}
> org.apache.nifi.processor.exception.FlowFileAccessException: Failed to
> import data from HttpInputOverHTTP@46e7d12e[c=15,q=0,[0]=null,s=EARLY_EOF]
> for
> StandardFlowFileRecord[uuid=32bb182d-f619-4b98-b6f8-c1ed50c2736a,claim=,offset=0,name=9714775822613527,size=0]
> due to org.apache.nifi.processor.exception.FlowFileAccessException: Unable
> to create ContentClaim due to org.eclipse.jetty.io.EofException: Early EOF
> at
> org.apache.nifi.controller.repository.StandardProcessSession.importFrom(StandardProcessSession.java:2942)
> at
> org.apache.nifi.processors.standard.HandleHttpRequest.onTrigger(HandleHttpRequest.java:517)
> at
> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
> at
> org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1123)
> at
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:147)
> at
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
> at
> org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:128)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.nifi.processor.exception.FlowFileAccessException:
> Unable to create ContentClaim due to org.eclipse.jetty.io.EofException: Early
> EOF
> at
> org.apache.nifi.controller.repository.StandardProcessSession.importFrom(StandardProcessSession.java:2935)
> ... 13 common frames omitted
> Caused by: org.eclipse.jetty.io.EofException: Early EOF
> at org.eclipse.jetty.server.HttpInput$3.getError(HttpInput.java:1104)
> at org.eclipse.jetty.server.HttpInput$3.noContent(HttpInput.java:1093)
> at org.eclipse.jetty.server.HttpInput.read(HttpInput.java:307)
> at java.io.InputStream.read(InputStream.java:101)
> at org.apache.nifi.stream.io.StreamUtils.copy(StreamUtils.java:35)
> at
> org.apache.nifi.controller.repository.FileSystemRepository.importFrom(FileSystemRepository.java:734)
> at org.apache.nifi.controller
>
>
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)