You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Steve Loughran (Jira)" <ji...@apache.org> on 2025/10/01 15:30:00 UTC
[jira] [Created] (HADOOP-19712) S3A: Deadlock observed in IOStatistics EvaluatingStatisticsMap.entryset()
Steve Loughran created HADOOP-19712:
---------------------------------------
Summary: S3A: Deadlock observed in IOStatistics EvaluatingStatisticsMap.entryset()
Key: HADOOP-19712
URL: https://issues.apache.org/jira/browse/HADOOP-19712
Project: Hadoop Common
Issue Type: Bug
Components: fs, fs/s3
Affects Versions: 3.4.2, 3.3.6
Reporter: Steve Loughran
Assignee: Steve Loughran
We have evidence that `IOStatisticsSupport.snapshotIOStatistics()` can hang, specifically on the statistics collected by an S3AInputStream, whose statistics are merged in to the FS stats in close();
{code}
jdk.internal.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:341)
java.util.concurrent.ForkJoinTask.awaitDone(ForkJoinTask.java:468)
java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:687)
java.util.stream.ReduceOps$ReduceOp.evaluateParallel(ReduceOps.java:927)
java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
org.apache.hadoop.fs.statistics.impl.EvaluatingStatisticsMap.entrySet(EvaluatingStatisticsMap.java:166)
java.util.Collections$UnmodifiableMap.entrySet(Collections.java:1529)
org.apache.hadoop.fs.statistics.impl.IOStatisticsBinding.copyMap(IOStatisticsBinding.java:172)
org.apache.hadoop.fs.statistics.impl.IOStatisticsBinding.snapshotMap(IOStatisticsBinding.java:216)
org.apache.hadoop.fs.statistics.impl.IOStatisticsBinding.snapshotMap(IOStatisticsBinding.java:199)
org.apache.hadoop.fs.statistics.IOStatisticsSnapshot.snapshot(IOStatisticsSnapshot.java:165)
org.apache.hadoop.fs.statistics.IOStatisticsSnapshot.<init>(IOStatisticsSnapshot.java:125)
org.apache.hadoop.fs.statistics.IOStatisticsSupport.snapshotIOStatistics(IOStatisticsSupport.java:49)
{code}
the code in question is calling `parallelStream()`, which uses a fixed pool of threads shared by all uses of the API
{code}
Set<Entry<String, E>> r = evalEntries.parallelStream().map((e) ->
new EntryImpl<>(e.getKey(), e.getValue().apply(e.getKey())))
.collect(Collectors.toSet());
{code}
Proposed:
* move off parallelStream() to stream()
* review code to if there is any other way this iteration can lead to a deadlock, e.g. the apply() calls.
* could we do the merge more efficiently?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org