Opened 50 years ago

Last modified 9 years ago

#904 new defect

IZ600: Unhelpful error messages when executing startup_jvm

Reported by: torsten Owned by:
Priority: low Milestone:
Component: hedeby Version: 1.0
Severity: Keywords: cli
Cc:

Description

[Imported from gridengine issuezilla http://gridengine.sunsource.net/issues/show_bug.cgi?id=600]

        Issue #:      600          Platform:     All         Reporter: torsten (torsten)
       Component:     hedeby          OS:        All
     Subcomponent:    cli          Version:      1.0            CC:    None defined
        Status:       NEW          Priority:     P4
      Resolution:                 Issue type:    DEFECT
                               Target milestone: 1.0u5next
      Assigned to:    adoerr (adoerr)
      QA Contact:     adoerr
          URL:
       * Summary:     Unhelpful error messages when executing startup_jvm
   Status whiteboard:
      Attachments:


     Issue 600 blocks:
   Votes for issue 600:     Vote for this issue


   Opened: Fri Nov 7 05:10:00 -0700 2008 
------------------------


   Description:
   The 'sdmadm startup_jvm' command does not work for most JVMs while the
   configuration service is not running on the SDM master host. This behavior is
   expected and OK. However, the error messages that are produced in this scenario
   are not very helpful:

   # to create the scenario:
   master% sdmadm shutdown_jvm -all

   # case 1
   master% sdmadm startup_jvm -j rp_vm
   [after some waiting time (output reformatted for better readability)]
   jvm   host   result message
   -------------------------------------------------------------------------------------------------------
   rp_vm master ERROR  Timeout. Pid file: /tmp/sdmtb/run/rp_vm@ master for JVM:
   rp_vm not found.

   # case 2
   managed% sdmadm startup_jvm
   Error: Creation of JNDI context failed, error: Context /tmp/sdmtb/spool/cs not
   found or this is not directory.

   In both cases an error message like the following (which is shown when e.g.
   executing the show_jvm command in this scenario) would be more helpful,
   possibly with an additional note saying something like "maybe the cs_vm is not
   running and needs to be started up":
   host% sdmadm show_jvm
   Error: Cannot connect to jvm cs_vm@master: Connection refused


   Evaluation:
   This is a usability issue. The error messages are unhelpful and do not guide
   the user in the right direction.


   Suggested Fix:
   Implement error messages like suggested in the issue description.


   Work Around:
   None.


   Analysis:
   The problem lies in ParentStartupService.java. The methods getJvmConf and
   getJvmConfList both check whether the configuration service (CS) is started. In
   case it is NOT started, the getJVMConfiguration(s)Command is executed locally.
   This should only happen on the master host, otherwise an error message has to
   be created.

   Therefore an if condition checking this needs to be inserted in lines 202 and
   220. This addresses case 2.

   Furthermore, if the CS is not running and we are on the master, the only JVM
   that can be started up is the cs_vm. So check this with
   SystemUtil.isCSJvmHostAndPort() after getting the JvmConfig in line 220 and
   throw an appropriate exception (case 1).

   While fixing this issue some additional refactoring might be beneficial:
   - the filtering in GetJVMConfiguration(s)Command could be done with a Filter
     and not with a String.
   - GetJVMConfigurationCommand and GetJVMConfigurationsCommand are very similar
     and could be combined into one class returning a List<JvmConfig>.
   - as a result of this, getJvmConfList and getJvmConf in ParentStartupService
     could be combined
   - the two start() methods in ParentStartupService contain duplicate code which
     could be extracted

   The class comment for ParentStartupService is totally outdated and should be
   fixed as well.

   Issue 459 could be fixed together with this, possibly profiting from
   the refactoring.


   How to test:
   Write a testsuite test that checks the behavior of the sytem when the
   configuration service is shutdown. It has to be checked that the expected
   descriptive error messages are displayed to the user.


   ETC:
   2 PD (with refactor, 1.5 PD without refactoring)
               ------- Additional comments from rhierlmeier Wed Nov 25 07:21:11 -0700 2009 -------
   Milestone changed

Change History (0)

Note: See TracTickets for help on using tickets.