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

Colin Patrick McCabe commented on HDFS-6803:
--------------------------------------------

I'm having trouble reconciling the idea that input streams "are not 
thread-safe" with the idea that multiple positional reads can be going on in 
parallel.  It seems like if clients are going to have multiple {{pread}} calls 
in flight, they are counting on thread-safety.  Maybe we can say that streams 
which implement {{PositionedReadable}} are thread-safe?

Are there still Hadoop FileSystem implementations out there that have input 
streams that are not thread-safe?  That seems like a recipe for broken code 
that runs on HDFS but not on other FSes.  It seems like if we do have any such 
FS implemntations, they could be fixed pretty easily by putting 
{{synchronized}} on the methods.

> Documenting DFSClient#DFSInputStream expectations reading and preading in 
> concurrent context
> --------------------------------------------------------------------------------------------
>
>                 Key: HDFS-6803
>                 URL: https://issues.apache.org/jira/browse/HDFS-6803
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>    Affects Versions: 2.4.1
>            Reporter: stack
>         Attachments: 9117.md.txt, DocumentingDFSClientDFSInputStream (1).pdf, 
> DocumentingDFSClientDFSInputStream.v2.pdf, HDFS-6803v2.txt
>
>
> Reviews of the patch posted the parent task suggest that we be more explicit 
> about how DFSIS is expected to behave when being read by contending threads. 
> It is also suggested that presumptions made internally be made explicit 
> documenting expectations.
> Before we put up a patch we've made a document of assertions we'd like to 
> make into tenets of DFSInputSteam.  If agreement, we'll attach to this issue 
> a patch that weaves the assumptions into DFSIS as javadoc and class comments. 



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

Reply via email to