[
https://issues.apache.org/jira/browse/MAPREDUCE-3562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286048#comment-13286048
]
Robert Joseph Evans commented on MAPREDUCE-3562:
------------------------------------------------
@Harsh
I agree that the close should only be called when shutting down, and there
should not be multiple threads calling it. But then what is the harm with
synchronizing it? From a defensive programming standpoint I would rather see
it synchronized because it is simple to do, and could potentially prevent an
error from happening in the future if someone uses the API incorrectly.
@Ravi
# The patch needs to be upmerged the Counters part no longer applies.
# Inside JobControl getWaitingJobList, getRunningJobList, and getReadyJobsList
really don't need to be synchronized because getJobsIn is already synchronized.
# Inside JobControl the synchronized statement in toList is unnecessary, and
should be removed to clean things up.
# I am a bit confused about the synchronization changes made to Counter.
CounterStrings.toEscapedCompactString appears to already handle the
synchronization properly, although it is hidden in there. I don't see why
these changes are needed.
# Also there appear to be a lot more threading issues in Counters, but I
haven't had time to dig into it that deeply to be sure. The big one I see is a
potential deadlock in Counters.Counter.equals, which seems odd, because there
appears to be no other synchronization anywhere else in that class, but I have
not dug that deeply into its parent class which probably has some
synchronization in it. Did you run into actual problems while running Hadoop or
are these just from inspecting the code?
> Concurrency issues in MultipleOutputs,JobControl,Counters
> ---------------------------------------------------------
>
> Key: MAPREDUCE-3562
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-3562
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Components: mrv2
> Affects Versions: 0.23.0
> Reporter: Ravi Teja Ch N V
> Assignee: Ravi Teja Ch N V
> Attachments: MAPREDUCE-3562.patch
>
>
> bq.MultipleOutputs
> The close of recordwriters should be synchronized.
> public void close() throws IOException, InterruptedException {
> for (RecordWriter writer : recordWriters.values()) {
> writer.close(context);
> bq.JobControl.java
> the getters of the jobs to be synchronized.
> bq.Counters.java
> makeEscapedCompactString to be made synchronized.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira