Github user markap14 commented on the issue:
https://github.com/apache/nifi/pull/2918
An easy way to test the PR is to try running the following code (updating
the URL in the second line of code to point to a running HandleHttpRequest
processor):
```
public static void main(final String[] args) throws Exception {
final URL url = new URL("http://localhost:8153/test");
final URLConnection conn = url.openConnection();
final HttpURLConnection connection = (HttpURLConnection) conn;
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setFixedLengthStreamingMode(1_000_000);
connection.connect();
final OutputStream out = connection.getOutputStream();
for (int i=0; i < 500_000; i++) {
out.write('A');
}
System.out.println("Sleeping...");
Thread.sleep(35000);
for (int i=0; i < 500_000; i++) {
out.write('A');
}
// read the output from the server
final BufferedReader reader = new BufferedReader(new
InputStreamReader(connection.getInputStream()));
final StringBuilder stringBuilder = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
stringBuilder.append(line + "\n");
}
System.out.println(stringBuilder.toString());
}
```
Before the PR, this caused an Exception after sleeping and NiFi did not
handle the request. After the PR, NiFI handles it properly and returns the
expected response.
---