Petals ESB Container

The launcher should return exit code according to how the container is started

Details

  • Type: Improvement Request Improvement Request
  • Status: New New
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 3.0.5
  • Fix Version/s: None
  • Component/s: Launcher
  • Security Level: Public
  • Description:
    Hide

    To be more usable in shell scripts, the launcher should return exit code according to how the container is started:

    • 0: the container starts successfully, and no error occurs during the recovering process,
    • 1: the container doesn't start,
    • 2: the container starts successfully, but an error occurs during the recovering process.
    Show
    To be more usable in shell scripts, the launcher should return exit code according to how the container is started:
    • 0: the container starts successfully, and no error occurs during the recovering process,
    • 1: the container doesn't start,
    • 2: the container starts successfully, but an error occurs during the recovering process.
  • Environment:
    -

Activity

Hide
Roland Naudin added a comment - Thu, 2 Sep 2010 - 14:17:39 +0200 - edited

I don't understand, the java process do not return any code until its termination.
Do you mean that the script itself must detect if there is error during recovering and return a code accordingly?
Is it for the petals exploitation tools?

Show
Roland Naudin added a comment - Thu, 2 Sep 2010 - 14:17:39 +0200 - edited I don't understand, the java process do not return any code until its termination. Do you mean that the script itself must detect if there is error during recovering and return a code accordingly? Is it for the petals exploitation tools?
Hide
Christophe DENEUX added a comment - Thu, 2 Sep 2010 - 14:51:12 +0200

The script launching Petals ESB as daemon should be able to return an exit code about the Petals ESB start status instead of returning the exit code of the command "nohup". The script will be in charge of detecting errors that occur during recovering.

Show
Christophe DENEUX added a comment - Thu, 2 Sep 2010 - 14:51:12 +0200 The script launching Petals ESB as daemon should be able to return an exit code about the Petals ESB start status instead of returning the exit code of the command "nohup". The script will be in charge of detecting errors that occur during recovering.
Hide
Christophe DENEUX added a comment - Fri, 3 Sep 2010 - 09:37:44 +0200

Today, the following trace is displayed when Petals ESB is started:
"PEtALS ESB platform distribution successfully started - 03/09/10 09:36"

Perhaps can you change this trace if errors occurs during recovering:
"PEtALS ESB platform distribution started with recovering errors - 03/09/10 09:36"
And the script will detect this trace to return the exit code

Show
Christophe DENEUX added a comment - Fri, 3 Sep 2010 - 09:37:44 +0200 Today, the following trace is displayed when Petals ESB is started: "PEtALS ESB platform distribution successfully started - 03/09/10 09:36" Perhaps can you change this trace if errors occurs during recovering: "PEtALS ESB platform distribution started with recovering errors - 03/09/10 09:36" And the script will detect this trace to return the exit code
Hide
Roland Naudin added a comment - Fri, 3 Sep 2010 - 09:45:04 +0200

A solution to get the info about the recovery errors would be to analyze the logs.
The problem is to know where is the log file from the script point of view.
So the script must analyze the logger.properties file for that.

Another solution would be to introduce an operation to the PetalsAdmin Mbean to get a recovery report.
Latter, with the robust mode, this operation may be interesting to the get the exchanges that can not be re-emit so can not be recovered.

Show
Roland Naudin added a comment - Fri, 3 Sep 2010 - 09:45:04 +0200 A solution to get the info about the recovery errors would be to analyze the logs. The problem is to know where is the log file from the script point of view. So the script must analyze the logger.properties file for that. Another solution would be to introduce an operation to the PetalsAdmin Mbean to get a recovery report. Latter, with the robust mode, this operation may be interesting to the get the exchanges that can not be re-emit so can not be recovered.
Hide
Christophe DENEUX added a comment - Fri, 3 Sep 2010 - 09:57:05 +0200

I like the "recovery report" idea

Show
Christophe DENEUX added a comment - Fri, 3 Sep 2010 - 09:57:05 +0200 I like the "recovery report" idea
Hide
Sébastien André added a comment - Fri, 15 Oct 2010 - 17:31:38 +0200 - edited

The current version of the launcher starts the ESB, provides a basic command line interface (console mode), and also tries to solve some OS specific issues (e.g. the lock file).

In the next release, the CLI component will be separated from the server and OS integration issues should be solved through platform specific packaging, and as a result the launcher will be super simplified.

I'm currently working on these three features, and the new launcher returns the exit code 1 when the startup sequence failed to complete.

A new handler in the PetalsStateListener class would be sufficient to notify the launcher of problems while starting and exit with the appropriate value.

I think we should review my code next week and commit as soon as possible.

Show
Sébastien André added a comment - Fri, 15 Oct 2010 - 17:31:38 +0200 - edited The current version of the launcher starts the ESB, provides a basic command line interface (console mode), and also tries to solve some OS specific issues (e.g. the lock file). In the next release, the CLI component will be separated from the server and OS integration issues should be solved through platform specific packaging, and as a result the launcher will be super simplified. I'm currently working on these three features, and the new launcher returns the exit code 1 when the startup sequence failed to complete. A new handler in the PetalsStateListener class would be sufficient to notify the launcher of problems while starting and exit with the appropriate value. I think we should review my code next week and commit as soon as possible.

People

Dates

  • Created:
    Thu, 2 Sep 2010 - 14:13:35 +0200
    Updated:
    Mon, 11 Jan 2016 - 15:46:34 +0100