polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Merlin <paulmer...@apache.org>
Subject Re: Don't throw Exceptions during Bootstrap
Date Sat, 25 Mar 2017 12:24:01 GMT

+1000 to more insight on assembly/bootstrap failures!

Sounds related to:
- Improved reporting on invalid assembly models
   https://issues.apache.org/jira/browse/POLYGENE-48
- Easily report full application assembly
   https://issues.apache.org/jira/browse/POLYGENE-49

POLYGENE-49 is about being able to serialize an application model.
But it doesn't address reporting on erroneous application models.

About startup and laziness, yes, getting as most errors as soon as 
possible would be a win.
It'd be interesting to measure the impact on startup time of removing 
that laziness, it may be reasonable.




Le 2017-03-25 04:54, Niclas Hedhman a écrit :
> Looking at this at the moment, and there is an "interesting" tradeoff, 
> that
> we should probably discuss.
> 
> A fair bit of deferred work is going on, i.e. delaying the work until 
> it is
> needed, in case it is not needed, which will improve start up time 
> quite a
> lot.
> 
> The down-side is that the structural problem is not showing up until 
> any
> time later, possibly in production.
> 
> I think we should remove this "lazy loading" of classes, and check
> everything possible at boot time.
> 
> WDAYT?
> 
> Niclas
> 
> On Fri, Mar 24, 2017 at 5:30 PM, Niclas Hedhman <niclas@hedhman.org> 
> wrote:
> 
>> Gang,
>> I was just thinking;
>> 
>> We want it to become more efficient to find the runtime problems. One 
>> of
>> the major problems is that one gets an exception after exception the 
>> first
>> time we try to get going with a new project or a new subsystem in an
>> existing project. And this start->exception->edit->compile cycle is
>> tedious and not fun.
>> 
>> Suggestion;
>> 1. Introduce a "bootstrapPhase" somewhere.
>> 2. Enhance ConstructionException with exact details of everything 
>> going on.
>> 3. Make the ConstructionException constructor private and introduce a
>> public static method to be called.
>> 4. If Application.mode() is development or test, and bootstrapPhase is
>> true, then add the Exception to a ThreadLocal list, otherwise throw
>> exception as previously.
>> 5. Figure out when bootstrap phase is "over", check if there are any
>> Excepitons in the list, if so, generate an elaborate, machine readable
>> report (for tooling) and abort. Otherwise clear bootstrapPhase and 
>> continue
>> as normal.
>> 
>> I am not sure if all structural problems can be caught in one swoop or
>> not, but I am sure it would be a big improvement. Also, there might be
>> other Exceptions that should be involved in this as well.
>> 
>> WDYT?
>> 
>> Cheers
>> --
>> Niclas Hedhman, Software Developer
>> http://polygene.apache.org <http://zest.apache.org> - New Energy for 
>> Java
>> 



Mime
View raw message