We haven't.  Elasticsearch does this before calling Tika.  Given that
the SecurityManager is slated to be removed in a version of Java we'll
get to by 2030, I was hesitant.

We have to defend against oom and infinite loops; if we protected
against literal System.exit with the SecurityManager, it frankly
wouldn't offer much.

On Wed, Jul 28, 2021 at 12:05 PM Ken Krugler
<kkrugler_li...@transpac.com> wrote:
>
> Hi Tim,
>
> Did we ever try this approach of catching the System.exit() call?
>
> https://stackoverflow.com/questions/5549720/how-to-prevent-calls-to-system-exit-from-terminating-the-jvm
>
> Though I imagine calling System.setSecurityManager() isn’t appropriate for a 
> library :)
>
> — Ken
>
>
> > On Jul 28, 2021, at 7:18 AM, Tim Allison <talli...@apache.org> wrote:
> >
> > All,
> >
> >  I'm trying to upgrade the surefire plugin in Apache Tika, and I'm
> > running into "forked vm terminated without properly saying goodbye"
> > [0].
> >
> >  Tika uses a bunch of dependencies we have no control over.  At one
> > point, we had a parser with a "feature" that called System.exit.  We
> > have code that defends against this kind of thing by forking and
> > monitoring the forked process for early termination, and we'd like to
> > test this forking code.  Is there any way to test this with more
> > recent versions of the surefire plugin, or is there a recommended
> > workaround?
> >
> >  Thank you.
> >
> >            Best,
> >
> >                  Tim
> >
> > [0] 
> > http://maven.apache.org/surefire/maven-surefire-plugin/faq.html#vm-termination
>
> --------------------------
> Ken Krugler
> http://www.scaleunlimited.com
> Custom big data solutions
> Flink, Pinot, Solr, Elasticsearch
>
>
>

Reply via email to