> On May 29, 2015, 1:56 a.m., Jun Rao wrote: > > core/src/main/scala/kafka/utils/timer/TimerTaskList.scala, line 106 > > <https://reviews.apache.org/r/34734/diff/2/?file=973959#file973959line106> > > > > Since this is under synchronized, it seems that remove should always > > return true?
Oh. You are right. I am not sure what I was thinking. > On May 29, 2015, 1:56 a.m., Jun Rao wrote: > > core/src/main/scala/kafka/utils/timer/TimerTaskList.scala, line 153 > > <https://reviews.apache.org/r/34734/diff/2/?file=973959#file973959line153> > > > > Not sure if I follow this comment. I meant "To cancel a task, it should be removed by calling cancel() to prevent it from reinsert." > On May 29, 2015, 1:56 a.m., Jun Rao wrote: > > core/src/main/scala/kafka/utils/timer/TimerTaskList.scala, lines 136-137 > > <https://reviews.apache.org/r/34734/diff/2/?file=973959#file973959line136> > > > > With this canceled flag, the logic is a bit more complicated since a > > few other places need to check this flag. Not sure how much this helps in > > reducing the probability of having a cancelled operation reinserted into > > the list. Do you think it's worth doing this? I believe that this will significantly eliminate canceled task being reinserted to a timing wheel or submitted to the task executor. - Yasuhiro ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/34734/#review85665 ----------------------------------------------------------- On May 29, 2015, 12:19 a.m., Yasuhiro Matsuda wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/34734/ > ----------------------------------------------------------- > > (Updated May 29, 2015, 12:19 a.m.) > > > Review request for kafka. > > > Bugs: KAFKA-2226 > https://issues.apache.org/jira/browse/KAFKA-2226 > > > Repository: kafka > > > Description > ------- > > fix a race condition in TimerTaskEntry.remove > > > Diffs > ----- > > core/src/main/scala/kafka/utils/timer/Timer.scala > b8cde820a770a4e894804f1c268b24b529940650 > core/src/main/scala/kafka/utils/timer/TimerTask.scala > 3407138115d579339ffb6b00e32e38c984ac5d6e > core/src/main/scala/kafka/utils/timer/TimerTaskList.scala > e7a96570ddc2367583d6d5590628db7e7f6ba39b > core/src/main/scala/kafka/utils/timer/TimingWheel.scala > e92aba3844dbf3372182e14536a5d98cf3366d73 > > Diff: https://reviews.apache.org/r/34734/diff/ > > > Testing > ------- > > > Thanks, > > Yasuhiro Matsuda > >
