> On Sept. 29, 2016, 7:08 p.m., Chris Pettitt wrote: > > You're not using an atomic compare and set (CAS), so you don't need an > > atomic ref - a volatile would be sufficient. However, if the code can be > > run in a multi-threaded path, you would indeed want to use CAS to dequeue > > the exception in one operation.
Right, the code can be run in a multiple threads, and we need CAS for keeping the first exception. I merged the changes inside LinkedIn, basically it does: 1) throw the exception in callback to the user in the next producer.send(), so the user can decide whether to fail or ignore 2) reopen the producer if the user decides to ignore the exception - Xinyu ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/52403/#review150907 ----------------------------------------------------------- On Sept. 29, 2016, 9 p.m., Xinyu Liu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/52403/ > ----------------------------------------------------------- > > (Updated Sept. 29, 2016, 9 p.m.) > > > Review request for samza, Navina Ramesh and Jagadish Venkatraman. > > > Repository: samza > > > Description > ------- > > Current the error log happens after produce close and reset the exception in > later callbacks, which caused the trouble shooting to be harder in cases of > multithreading. We should log error before closing and keep atomic reference > of the initial exception. > > > Diffs > ----- > > > samza-kafka/src/main/scala/org/apache/samza/system/kafka/KafkaSystemProducer.scala > 5ff6d3caf54ed148aa40c7c752c587e556a4f34a > > Diff: https://reviews.apache.org/r/52403/diff/ > > > Testing > ------- > > Tested in jobs deployed in Yarn cluster. > > > Thanks, > > Xinyu Liu > >