Return-Path: X-Original-To: apmail-aurora-dev-archive@minotaur.apache.org Delivered-To: apmail-aurora-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 31E4F10C0C for ; Sat, 14 Dec 2013 18:15:40 +0000 (UTC) Received: (qmail 51173 invoked by uid 500); 14 Dec 2013 18:15:40 -0000 Delivered-To: apmail-aurora-dev-archive@aurora.apache.org Received: (qmail 51151 invoked by uid 500); 14 Dec 2013 18:15:40 -0000 Mailing-List: contact dev-help@aurora.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aurora.incubator.apache.org Delivered-To: mailing list dev@aurora.incubator.apache.org Received: (qmail 51143 invoked by uid 99); 14 Dec 2013 18:15:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Dec 2013 18:15:40 +0000 X-ASF-Spam-Status: No, hits=-1997.9 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE,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; Sat, 14 Dec 2013 18:15:38 +0000 Received: (qmail 51110 invoked by uid 99); 14 Dec 2013 18:15:18 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Dec 2013 18:15:18 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 538821D3F20; Sat, 14 Dec 2013 18:15:17 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============4764647363940906750==" MIME-Version: 1.0 Subject: Re: Review Request 16261: Now treating empty log file as new log file in test. From: "Bill Farner" To: "Bill Farner" , "Zameer Manji" , "Maxim Khutornenko" , "Kevin Sweeney" Cc: "Aurora" , "Suman Karumuri" Date: Sat, 14 Dec 2013 18:15:17 -0000 Message-ID: <20131214181517.15782.55998@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Bill Farner" X-ReviewGroup: Aurora X-ReviewRequest-URL: https://reviews.apache.org/r/16261/ X-Sender: "Bill Farner" References: <20131214034446.15782.53581@reviews.apache.org> In-Reply-To: <20131214034446.15782.53581@reviews.apache.org> Reply-To: "Bill Farner" X-ReviewRequest-Repository: aurora X-Virus-Checked: Checked by ClamAV on apache.org --===============4764647363940906750== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/16261/#review30422 ----------------------------------------------------------- src/test/java/com/twitter/aurora/scheduler/log/testing/FileLogTest.java we use junit 4, which does not require extending TestCase src/test/java/com/twitter/aurora/scheduler/log/testing/FileLogTest.java I realized shortly after recommending FileUtils that guava has Files.createTempDir. Sorry for the misdirection — mind using guava's routine instead? src/test/java/com/twitter/aurora/scheduler/log/testing/FileLogTest.java File has a constructor intended for this, which is agnostic to the system's path separator: http://docs.oracle.com/javase/7/docs/api/java/io/File.html#File(java.io.File, java.lang.String) src/test/java/com/twitter/aurora/scheduler/log/testing/FileLogTest.java generally we place @After adjacent to @Before, to easily see symmetry src/test/java/com/twitter/aurora/scheduler/log/testing/FileLogTest.java Don't bother asserting on these. Assertion errors here will likely just create a red herring. - Bill Farner On Dec. 14, 2013, 3:44 a.m., Suman Karumuri wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/16261/ > ----------------------------------------------------------- > > (Updated Dec. 14, 2013, 3:44 a.m.) > > > Review request for Aurora, Kevin Sweeney, Maxim Khutornenko, Bill Farner, and Zameer Manji. > > > Repository: aurora > > > Description > ------- > > Now treating empty log file as new log file in test. > > > Diffs > ----- > > src/main/java/com/twitter/aurora/scheduler/log/testing/FileLog.java cb5cc874de161a0b992594c83469acfcd61e78ee > src/test/java/com/twitter/aurora/scheduler/log/testing/FileLogTest.java PRE-CREATION > > Diff: https://reviews.apache.org/r/16261/diff/ > > > Testing > ------- > > Gradle clean build. > > Tested with the isolated scheduler and an empty log file. > ? git:(master) ? ls -lh /tmp/testing_log_file ~/workspace/incubator-aurora > -rw-r--r-- 1 skarumuri wheel 0B Dec 13 14:56 /tmp/testing_log_file > > Ran it on master: > > Running on an empty file would result in an exception as follows: > > E1213 22:58:26.660 THREAD1 org.apache.zookeeper.server.NIOServerCnxn$Factory$1.uncaughtException: Thread Thread[main,5,main] died > java.lang.IllegalStateException: Failed to open the log, cannot continue > at com.twitter.aurora.scheduler.storage.log.LogStorage.prepare(LogStorage.java:289) > at com.twitter.aurora.scheduler.storage.CallOrderEnforcingStorage.prepare(CallOrderEnforcingStorage.java:80) > at com.twitter.aurora.scheduler.SchedulerLifecycle.prepare(SchedulerLifecycle.java:144) > at com.twitter.aurora.scheduler.app.SchedulerMain.run(SchedulerMain.java:255) > at com.twitter.common.application.AppLauncher.run(AppLauncher.java:102) > at com.twitter.common.application.AppLauncher.launch(AppLauncher.java:181) > at com.twitter.common.application.AppLauncher.launch(AppLauncher.java:142) > at com.twitter.aurora.scheduler.app.SchedulerMain.main(SchedulerMain.java:276) > Caused by: java.io.IOException: Failed to interpret log contents: com.twitter.aurora.codec.ThriftBinaryCodec$CodingException: Failed to deserialize thrift object. > at com.twitter.aurora.scheduler.log.testing.FileLog.open(FileLog.java:80) > at com.twitter.aurora.scheduler.storage.log.LogManager.open(LogManager.java:123) > at com.twitter.aurora.scheduler.storage.log.LogStorage.prepare(LogStorage.java:287) > ... 7 more > Caused by: com.twitter.aurora.codec.ThriftBinaryCodec$CodingException: Failed to deserialize thrift object. > at com.twitter.aurora.codec.ThriftBinaryCodec.decodeNonNull(ThriftBinaryCodec.java:86) > at com.twitter.aurora.codec.ThriftBinaryCodec.decode(ThriftBinaryCodec.java:59) > at com.twitter.aurora.scheduler.log.testing.FileLog.open(FileLog.java:67) > ... 9 more > Caused by: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes. (This is often indicative of an internal error on the server side. Please check your server logs.) > at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86) > at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:362) > at org.apache.thrift.protocol.TBinaryProtocol.readByte(TBinaryProtocol.java:251) > at org.apache.thrift.protocol.TBinaryProtocol.readFieldBegin(TBinaryProtocol.java:215) > at com.twitter.aurora.gen.test.FileLogContents$FileLogContentsStandardScheme.read(FileLogContents.java:349) > at com.twitter.aurora.gen.test.FileLogContents$FileLogContentsStandardScheme.read(FileLogContents.java:342) > at com.twitter.aurora.gen.test.FileLogContents.read(FileLogContents.java:292) > at org.apache.thrift.TDeserializer.deserialize(TDeserializer.java:69) > at com.twitter.aurora.codec.ThriftBinaryCodec.decodeNonNull(ThriftBinaryCodec.java:79) > ... 11 more > > I1213 22:58:27.001 THREAD11 org.apache.zookeeper.server.SessionTrackerImpl.run: SessionTrackerImpl exited loop! > UnresettableLogManager is ignoring a reset() request. > I1213 22:58:27.002 THREAD14 com.twitter.common.application.ShutdownRegistry$ShutdownRegistryImpl.execute: Action controller has already completed, subsequent calls ignored. > > After the fix: No exception. > > > Thanks, > > Suman Karumuri > > --===============4764647363940906750==--