Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 73616 invoked from network); 16 Jun 2008 16:06:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jun 2008 16:06:38 -0000 Received: (qmail 16951 invoked by uid 500); 16 Jun 2008 16:06:38 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 16922 invoked by uid 500); 16 Jun 2008 16:06:38 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 16911 invoked by uid 99); 16 Jun 2008 16:06:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jun 2008 09:06:37 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jun 2008 16:05:56 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2E96A234C14B for ; Mon, 16 Jun 2008 09:05:45 -0700 (PDT) Message-ID: <909083968.1213632345189.JavaMail.jira@brutus> Date: Mon, 16 Jun 2008 09:05:45 -0700 (PDT) From: "Aaron Greenhouse (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Updated: (HADOOP-3553) Nested class TaskTracker.TaskInProgress needs additional synchronization In-Reply-To: <336796174.1213366605316.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-3553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Aaron Greenhouse updated HADOOP-3553: ------------------------------------- Attachment: (was: TaskTracker.patch) > Nested class TaskTracker.TaskInProgress needs additional synchronization > ------------------------------------------------------------------------ > > Key: HADOOP-3553 > URL: https://issues.apache.org/jira/browse/HADOOP-3553 > Project: Hadoop Core > Issue Type: Bug > Components: mapred > Affects Versions: 0.17.0 > Environment: All Java platforms > Reporter: Aaron Greenhouse > Attachments: HADOOP-3553.patch > > Original Estimate: 1h > Remaining Estimate: 1h > > The nested class TaskTracker.TaskInProgress needs additional synchronization to work properly with the Java Memory Model. Presumably this class is accessed by more than one thread, because it already contains synchronization. However, it needs additional synchronization, especially to protect access to the long fields lastProgressReport and taskTimeOut. Long fields are not guaranteed to be read/written atomically, so not only do you risk reading stale values, but you risk reading corrupted values. > The field wasKilled also needs synchronization, as it is polled from within the TaskTracker class. > I suggest the following improvements to the class > - Make the fields task and taskStatus final. They are used this way already. Making them final clarifies there behavior in a current environment. > - Add the synchronized modifier to the methods getLastProgressReport() and getTaskTimeout(). > - Make the field wasKilled private and add a new public synchronized wasKilled() getter method. Replace the use of the field with this method in TaskTracker. > - Add a comment to localizeTask() indicating that the caller must be synchronized on this. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.