Bug 114446

Summary: No way for Startup process to differentiate between web and command line invocation
Product: [Retired] Red Hat Web Application Framework Reporter: Daniel Berrangé <berrange>
Component: otherAssignee: ccm-bugs-list
Status: CLOSED WONTFIX QA Contact: Jon Orris <jorris>
Severity: medium Docs Contact:
Priority: medium    
Version: nightlyCC: vnasardinov
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-08-03 18:43:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel Berrangé 2004-01-28 10:28:02 UTC
Description of problem:
When writing command line programs it is typically required that WAF
be initialized. This is achieved by invoking the c.a.runtime.Startup
class' startup() method. At the same time, however, ther are a number
of things that do not need to be initialized for a command line tool,
or indeed could cause race/error conditions if the tool were run on
the same host that had a servlet active. Thus there needs to be some
way to inform the impl's of c.a.runtime.INitializer what context they
are being run in, enabling them to bypass any servlet specific startup
processes when being run from the command line.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Vadim Nasardinov 2004-01-28 12:51:51 UTC
To start a list of things that don't need to be run when Startup
is called from a command-line tool/program:

  1. Most TimerTask background threads do not need to be started.
  2. ...

Anything else?

On a related note, there used to be a way to run a subset of 
initializers when invoking unit tests.  Currently, all initializers
are run, which makes unit testing noticeably slower.  Even if I only
want to run a single suite in Core, I have to wait for a bunch of
other initializers to finish (CMS, formsectionitem, formitem, forum,
portalserver - you name it).  This may merit a separate ticket though.


Comment 2 Daniel Berrangé 2004-01-28 13:01:05 UTC
WRT to unit tests, I'm of the opinion that you should only have the
application you're running tests in (and its dependents) loaded in the
system. Having other unrelated applications present can break
assumptions made by the authors of the unit tests, causing false
failures. Not running the initializers of these unrelated apps is
likely to make the situation worse, for example if the test gets an
object for which there is no instantiator present.

Comment 3 Rafael H. Schloming 2004-01-28 15:39:17 UTC
Regarding the problem described in the ticket I believe we've
discussed addressing the issue by moving web specific startup
activities to servlet init methods and reserving the initializer
system for truly environment agnostic stuff. Are you suggesting
another approach or simply observing that we still need to do this?

Comment 4 Daniel Berrangé 2004-01-28 15:43:03 UTC
Just observing the need for a solution, no particular opinion on the
approach we decide to take at this time.

Comment 5 Vadim Nasardinov 2005-08-03 18:43:57 UTC
slate