Return-Path: X-Original-To: apmail-helix-commits-archive@minotaur.apache.org Delivered-To: apmail-helix-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 735B817936 for ; Mon, 23 Mar 2015 17:27:37 +0000 (UTC) Received: (qmail 79525 invoked by uid 500); 23 Mar 2015 17:27:37 -0000 Delivered-To: apmail-helix-commits-archive@helix.apache.org Received: (qmail 79495 invoked by uid 500); 23 Mar 2015 17:27:37 -0000 Mailing-List: contact commits-help@helix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@helix.apache.org Delivered-To: mailing list commits@helix.apache.org Received: (qmail 79486 invoked by uid 99); 23 Mar 2015 17:27:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Mar 2015 17:27:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 23 Mar 2015 17:27:14 +0000 Received: (qmail 79302 invoked by uid 99); 23 Mar 2015 17:27:11 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Mar 2015 17:27:11 +0000 Date: Mon, 23 Mar 2015 17:27:10 +0000 (UTC) From: "Lei Xia (JIRA)" To: commits@helix.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HELIX-584) SimpleDateFormat should not be used as singleton due to its race conditions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HELIX-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lei Xia resolved HELIX-584. --------------------------- Resolution: Fixed > SimpleDateFormat should not be used as singleton due to its race conditions > --------------------------------------------------------------------------- > > Key: HELIX-584 > URL: https://issues.apache.org/jira/browse/HELIX-584 > Project: Apache Helix > Issue Type: Bug > Reporter: Lei Xia > Assignee: Lei Xia > > SimpleDateFormat is used in workflowConfig as a singleton. But since it is not thread-safe (refer here: http://www.hpenterprisesecurity.com/vulncat/en/vulncat/java/race_condition_format_flaw.html), it will mess up the output date format sometime due to race condition. > An example trace stack for such failure: > Message: > For input string: "2003.E2003E22" > Full Stacktrace: > java.lang.NumberFormatException: For input string: "2003.E2003E22" > at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1222) > at java.lang.Double.parseDouble(Double.java:510) > at java.text.DigitList.getDouble(DigitList.java:151) > at java.text.DecimalFormat.parse(DecimalFormat.java:1302) > at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1935) > at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1311) > at java.text.DateFormat.parse(DateFormat.java:335) > at org.apache.helix.task.TaskUtil.parseScheduleFromConfigMap(TaskUtil.java:365) > at org.apache.helix.task.WorkflowConfig$Builder.fromMap(WorkflowConfig.java:173) > at org.apache.helix.task.TaskUtil.getWorkflowCfg(TaskUtil.java:113) > at org.apache.helix.task.TaskUtil.getWorkflowCfg(TaskUtil.java:126) > at org.apache.helix.integration.task.TestUtil.pollForJobState(TestUtil.java:61) > at org.apache.helix.integration.task.TestTaskRebalancerStopResume.stopDeleteJobAndResumeRecurrentQueue(TestTaskRebalancerStopResume.java:420) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:76) > at org.testng.internal.Invoker.invokeMethod(Invoker.java:673) > at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:846) > at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1170) > at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) > at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) > at org.testng.TestRunner.runWorkers(TestRunner.java:1147) > at org.testng.TestRunner.privateRun(TestRunner.java:749) > at org.testng.TestRunner.run(TestRunner.java:600) > at org.testng.SuiteRunner.runTest(SuiteRunner.java:317) > at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312) > at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274) > at org.testng.SuiteRunner.run(SuiteRunner.java:223) > at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) > at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) > at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039) > at org.testng.TestNG.runSuitesLocally(TestNG.java:964) > at org.testng.TestNG.run(TestNG.java:900) > at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:178) > at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92) > at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:96) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208) > at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:158) > at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86) > at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) > at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95) -- This message was sent by Atlassian JIRA (v6.3.4#6332)