scwhittle commented on pull request #11351: URL: https://github.com/apache/beam/pull/11351#issuecomment-708619117
On Wed, Oct 14, 2020, 7:06 PM Lukasz Cwik <[email protected]> wrote: > That would work. > > Hi @lukecwik <https://github.com/lukecwik> - Interestingly enough, I'm > having it failing on the 2.23.0 version ? > > Code : catch (Exception e) { > System.out.println("Failed to filter user data " + c.element()); > e.printStackTrace(); > > I assume to work around would be to change it from send it to StackTrace > to another print out ? > > Errror : > java.lang.IllegalStateException: BEAM-9399 > <https://issues.apache.org/jira/browse/BEAM-9399>: publish should not be > called with the lock as it may cause deadlock > at > org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkState(Preconditions.java:507) > at > org.apache.beam.runners.dataflow.worker.logging.JulHandlerPrintStreamAdapterFactory$JulHandlerPrintStream.publishIfNonEmpty(JulHandlerPrintStreamAdapterFactory.java:380) > at > org.apache.beam.runners.dataflow.worker.logging.JulHandlerPrintStreamAdapterFactory$JulHandlerPrintStream.println(JulHandlerPrintStreamAdapterFactory.java:332) > at java.lang.Throwable$WrappedPrintStream.println(Throwable.java:748) > at java.lang.Throwable.printStackTrace(Throwable.java:655) > at java.lang.Throwable.printStackTrace(Throwable.java:643) > at java.lang.Throwable.printStackTrace(Throwable.java:634) > at > com.metix.historic.transforms.FilterAndMapPatientsByAge.processElement(FilterAndMapPatientsByAge.java:25) > > Yes, using another printstream would work around the issue. > Could also avoid e.printStackTrace() and instead print the stack trace to a string and then print, for example using https://guava.dev/releases/23.0/api/docs/com/google/common/base/Throwables.html#getStackTraceAsString-java.lang.Throwable- System.out.println("Failed to filter user data " + c.element() + " " + Throwables.getStackTraceAsString(e)); > @scwhittle <https://github.com/scwhittle> Any ideas as to why it would be > broken in 2.23? > It is broken because https://github.com/apache/beam/pull/11096 changed a potential deadlock into consistent IllegalStateException. This was unintended, I didn't consider that other things might synchronize on the overridden System.err PrintStream. Throwable.printStackTrace does this. This was fixed by https://github.com/apache/beam/pull/12825 which was cherrypicked to the 2.25 release. The commit comment there has more details. > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/apache/beam/pull/11351#issuecomment-708536481>, or > unsubscribe > <https://github.com/notifications/unsubscribe-auth/ABBZZTC4FDINTANLXPZTNUDSKXLCLANCNFSM4MEFYJFQ> > . > ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
