[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: LingeredApp termination sequence
From:       Dmitry Samersoff <dms () samersoff ! net>
Date:       2019-03-30 13:46:44
Message-ID: 27b13316-90c8-80d1-d751-9db70249d166 () samersoff ! net
[Download RAW message or body]

Hello Gary,

The LingeredApp was designed to provide precise control over the life
cycle of a subordinate process.

This means that if the app exits unexpectedly, we should have detailed
information why it happens.

IOException may occur when the app tries to touch lockfile (e.g. due to
a network filesystem error), so it might be better to catch IOException,
then check if it is an instance of NoSuchFileException or the lockfile
was deleted by driver.

-Dmitry

On 29.03.2019 20:12, Gary Adams wrote:
> While running some bulk testing on jdk/sun/tools I've
> come across some errors reported from the termination sequence
> for LingeredApp debuggee process.
> 
> The main process creates a locking file, which the LingeredApp
> sits in a loop updating the file modification date. When the main
> test completes it stops the LingeredApp by removing the file.
> 
> The clean exit results when LingeredApp gets a NoSuchFileException.
> I see a number of bugs filed that are getting a raw IOException
> on the LingeredApp termination.
> 
> I'm going to attempt to get more specific information about the
> IOException.
> 
> diff --git a/test/lib/jdk/test/lib/apps/LingeredApp.java
> b/test/lib/jdk/test/lib/apps/LingeredApp.java
> --- a/test/lib/jdk/test/lib/apps/LingeredApp.java
> +++ b/test/lib/jdk/test/lib/apps/LingeredApp.java
> @@ -504,6 +504,9 @@
>                  } catch (NoSuchFileException ex) {
>                          // Lock deleted while we are setting last modified time.
>                          // Ignore error and lets the app exits
> +               } catch (IOException ioe) {
> +                       ioe.printStackTrace();
> +                       System.exit(3);
>                  } catch (Exception ex) {
>                          System.err.println("LingeredApp ERROR: " + ex);
>                          // Leave exit_code = 1 to Java launcher
> 
> Since the error is being detected as the test is terminating,
> I think it would be possible to simply replace the NoSuchFileException,
> and consider an IOException as the trigger for the clean exit sequence.
> 
> Anyone have experience with this corner of the swamp?
> 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic