Go to file
Steve Loughran c69e16b297
HADOOP-18410. S3AInputStream.unbuffer() does not release http connections (#4766)
HADOOP-16202 "Enhance openFile()" added asynchronous draining of the 
remaining bytes of an S3 HTTP input stream for those operations
(unbuffer, seek) where it could avoid blocking the active
thread.

This patch fixes the asynchronous stream draining to work and so
return the stream back to the http pool. Without this, whenever
unbuffer() or seek() was called on a stream and an asynchronous
drain triggered, the connection was not returned; eventually
the pool would be empty and subsequent S3 requests would
fail with the message "Timeout waiting for connection from pool"

The root cause was that even though the fields passed in to drain() were
converted to references through the methods, in the lambda expression
passed in to submit, they were direct references

operation = client.submit(
 () -> drain(uri, streamStatistics,
       false, reason, remaining,
       object, wrappedStream));  /* here */

Those fields were only read during the async execution, at which
point they would have been set to null (or even a subsequent read).

A new SDKStreamDrainer class peforms the draining; this is a Callable
and can be submitted directly to the executor pool.

The class is used in both the classic and prefetching s3a input streams.

Also, calling unbuffer() switches the S3AInputStream from adaptive
to random IO mode; that is, it is considered a cue that future
IO will not be sequential, whole-file reads.

Contributed by Steve Loughran.
2022-08-31 11:16:52 +01:00
.github
dev-support
hadoop-assemblies
hadoop-build-tools
hadoop-client-modules
hadoop-cloud-storage-project
hadoop-common-project HADOOP-18428. Parameterize platform toolset version (#4815) 2022-08-30 22:41:03 +05:30
hadoop-dist
hadoop-hdfs-project HDFS-16735. Reduce the number of HeartbeatManager loops. (#4780). Contributed by Shuyan Zhang. 2022-08-29 11:30:21 +08:00
hadoop-mapreduce-project MAPREDUCE-7403. manifest-committer dynamic partitioning support. (#4728) 2022-08-24 11:18:19 +01:00
hadoop-maven-plugins
hadoop-minicluster
hadoop-project Revert "HADOOP-18417. Upgrade to M7 of surefire plugin (#4795)" 2022-08-25 03:44:49 +05:30
hadoop-project-dist
hadoop-tools HADOOP-18410. S3AInputStream.unbuffer() does not release http connections (#4766) 2022-08-31 11:16:52 +01:00
hadoop-yarn-project YARN-11287. Fix NoClassDefFoundError: org/junit/platform/launcher/core/LauncherFactory after YARN-10793 (#4828) 2022-08-30 20:41:04 +09:00
licenses
licenses-binary
.asf.yaml
.gitattributes
.gitignore
BUILDING.txt
LICENSE-binary HADOOP-18361. Update commons-net from 3.6 to 3.8.0. (#4683). Contributed by fanshilun. 2022-08-24 20:05:17 +05:30
LICENSE.txt
NOTICE-binary
NOTICE.txt
README.txt
pom.xml
start-build-env.sh

README.txt

For the latest information about Hadoop, please visit our website at:

   http://hadoop.apache.org/

and our wiki, at:

   https://cwiki.apache.org/confluence/display/HADOOP/