SessionManager (aka new startup / shutdown list manager) needs testers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

SessionManager (aka new startup / shutdown list manager) needs testers

demarey
Hi,

Guillermo, Pablo and I started to work on a new implementation for the image startup / shutdown list.
The old implementation misses domain objects, polluted the SmalltalkImage class and introduced crazy dependencies to other packages.

So, what is Session Manager?
  • a replacement of the Session class (is now WorkingSession)
  • a rewrite of startup / shutdown list with domain objects 
    • SessionManager: can create new sessions and manage categories. Also provide a facade to register new session handlers. Session manager provide sthe list of handlers by order of priority (categories order and categories priority) either for the startup or the shutdown, 
    • WorkingSession: unique object for the current smalltalk session (I.e. between a startup and a shutdown). On each image startup the current session is invalidated and a new session is created. Define how errors should be handled. Run the startup / shutdown process. 
    • SessionCategory: we defined some well known categories for startup / shutdown: system, network, GUI, tools and there is room to add user specific categories, It help to run the handler at the right time without caring about the whole order.
    • and SessionHandlers: handleSession for a specific class or any other object.
  • the shutdown list is now simply the startup list reversed
  • we also refactored error handling at startup by using the UIManager and StartupUIManager. It allowed to remove ugly checks like #isInteractive, isHeadless in error handling methods and centralize that in UIManager.

You can find an image with the new SessionManager in action here: https://ci.inria.fr/pharo-contribution/job/SessionManager/

As it is a critical piece of code, could you play / test it a bit before we integrate this new mechanism in the Pharo image?

Regards,
Christophe

ps: Pharo tests pass
ps2: There is still some code to clean / remove from the old startup management system.

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SessionManager (aka new startup / shutdown list manager) needs testers

Nicolai Hess-3-2


2015-12-04 13:39 GMT+01:00 Christophe Demarey <[hidden email]>:
Hi,

Guillermo, Pablo and I started to work on a new implementation for the image startup / shutdown list.
The old implementation misses domain objects, polluted the SmalltalkImage class and introduced crazy dependencies to other packages.

So, what is Session Manager?
  • a replacement of the Session class (is now WorkingSession)
  • a rewrite of startup / shutdown list with domain objects 
    • SessionManager: can create new sessions and manage categories. Also provide a facade to register new session handlers. Session manager provide sthe list of handlers by order of priority (categories order and categories priority) either for the startup or the shutdown, 
    • WorkingSession: unique object for the current smalltalk session (I.e. between a startup and a shutdown). On each image startup the current session is invalidated and a new session is created. Define how errors should be handled. Run the startup / shutdown process. 
    • SessionCategory: we defined some well known categories for startup / shutdown: system, network, GUI, tools and there is room to add user specific categories, It help to run the handler at the right time without caring about the whole order.
    • and SessionHandlers: handleSession for a specific class or any other object.
  • the shutdown list is now simply the startup list reversed
  • we also refactored error handling at startup by using the UIManager and StartupUIManager. It allowed to remove ugly checks like #isInteractive, isHeadless in error handling methods and centralize that in UIManager.

You can find an image with the new SessionManager in action here: https://ci.inria.fr/pharo-contribution/job/SessionManager/

As it is a critical piece of code, could you play / test it a bit before we integrate this new mechanism in the Pharo image?

Looks good. What are the main critical startup/shutdown users( classes) that should be tested?
I did some tests with AthensSceneView (uses NB and calls Smalltalk session for reinit external resources) and Roassal.
I got one image startup failure, but I couldn't reproduce it yet. Maybe I did image save and image save and quit, too quick.
 

Regards,
Christophe

ps: Pharo tests pass
ps2: There is still some code to clean / remove from the old startup management system.

Reply | Threaded
Open this post in threaded view
|

Re: SessionManager (aka new startup / shutdown list manager) needs testers

demarey



De: "Nicolai Hess" <[hidden email]>
À: "Pharo Development List" <[hidden email]>
Envoyé: Vendredi 4 Décembre 2015 22:05:26
Objet: Re: [Pharo-dev] SessionManager (aka new startup / shutdown list manager) needs testers


Looks good. What are the main critical startup/shutdown users( classes) that should be tested?
Classes using startup or/and shutdown are
#SmallInteger
#Delay atPriority
#ProcessorScheduler
#InputEventFetche
#InputEventFetcher
#OSPlatfor
#Stdio
#LanguageEnvironment
#ShortIntegerArray
#DiskStore
#SmalltalkImage
#WeakFinalizationList
#Clipboard
#MCMethodDefinition
#Symbol
#Locale
#MultiByteFileStream
#WeakArray
#FileStream
#FileLocator
#BasicCommandLineHandler
#NonInteractiveTranscript
#ASTCache
#OSEnvironment
#EndianDetector
#InternetConfiguration
#ZnServer
#MCGitHubRepository
#ZnLogEvent
#DisplayScreen
#InputEventSensor
#Cursor
#Form
#StrikeFont
#Color
#FreeTypeCache
#LogicalFont
#FT2Handle
#FreeTypeSettings
#WorldMorph
#CPUWatcher
#NOCCompletionTable
#Nautilus
#PharoCommonTools
#GTPlayBook
Also sensitive code could be the one using the session (Smalltalk session) to check if they need to free or reset some resources.

Thanks to have a look at it,
Christophe

I did some tests with AthensSceneView (uses NB and calls Smalltalk session for reinit external resources) and Roassal.
I got one image startup failure, but I couldn't reproduce it yet. Maybe I did image save and image save and quit, too quick.

Reply | Threaded
Open this post in threaded view
|

Re: SessionManager (aka new startup / shutdown list manager) needs testers

Aliaksei Syrel
When deleting a class I get deprecation in #50561 in SystemDictionary>>#forgetClass: aClass logged: aBool  because of removeFromStartUpList:


Cheers,
Alex

On Sat, Dec 5, 2015 at 2:39 PM, Christophe Demarey <[hidden email]> wrote:



De: "Nicolai Hess" <[hidden email]>
À: "Pharo Development List" <[hidden email]>
Envoyé: Vendredi 4 Décembre 2015 22:05:26
Objet: Re: [Pharo-dev] SessionManager (aka new startup / shutdown list manager) needs testers


Looks good. What are the main critical startup/shutdown users( classes) that should be tested?
Classes using startup or/and shutdown are
#SmallInteger
#Delay atPriority
#ProcessorScheduler
#InputEventFetche
#InputEventFetcher
#OSPlatfor
#Stdio
#LanguageEnvironment
#ShortIntegerArray
#DiskStore
#SmalltalkImage
#WeakFinalizationList
#Clipboard
#MCMethodDefinition
#Symbol
#Locale
#MultiByteFileStream
#WeakArray
#FileStream
#FileLocator
#BasicCommandLineHandler
#NonInteractiveTranscript
#ASTCache
#OSEnvironment
#EndianDetector
#InternetConfiguration
#ZnServer
#MCGitHubRepository
#ZnLogEvent
#DisplayScreen
#InputEventSensor
#Cursor
#Form
#StrikeFont
#Color
#FreeTypeCache
#LogicalFont
#FT2Handle
#FreeTypeSettings
#WorldMorph
#CPUWatcher
#NOCCompletionTable
#Nautilus
#PharoCommonTools
#GTPlayBook
Also sensitive code could be the one using the session (Smalltalk session) to check if they need to free or reset some resources.

Thanks to have a look at it,
Christophe

I did some tests with AthensSceneView (uses NB and calls Smalltalk session for reinit external resources) and Roassal.
I got one image startup failure, but I couldn't reproduce it yet. Maybe I did image save and image save and quit, too quick.


Reply | Threaded
Open this post in threaded view
|

Re: SessionManager (aka new startup / shutdown list manager) needs testers

Aliaksei Syrel
UIManagerSessionHandler>>#startup: isImageStarting
"Install the right UIManager"
UIManager default: UIManager forCurrentSystemConfiguration.

Setting (overring current one) default UIManager each time image is saved/started up prevents us from having custom UIManagers, for example Bloc UI manager

On Tue, Feb 2, 2016 at 7:04 PM, Aliaksei Syrel <[hidden email]> wrote:
When deleting a class I get deprecation in #50561 in SystemDictionary>>#forgetClass: aClass logged: aBool  because of removeFromStartUpList:


Cheers,
Alex

On Sat, Dec 5, 2015 at 2:39 PM, Christophe Demarey <[hidden email]> wrote:



De: "Nicolai Hess" <[hidden email]>
À: "Pharo Development List" <[hidden email]>
Envoyé: Vendredi 4 Décembre 2015 22:05:26
Objet: Re: [Pharo-dev] SessionManager (aka new startup / shutdown list manager) needs testers


Looks good. What are the main critical startup/shutdown users( classes) that should be tested?
Classes using startup or/and shutdown are
#SmallInteger
#Delay atPriority
#ProcessorScheduler
#InputEventFetche
#InputEventFetcher
#OSPlatfor
#Stdio
#LanguageEnvironment
#ShortIntegerArray
#DiskStore
#SmalltalkImage
#WeakFinalizationList
#Clipboard
#MCMethodDefinition
#Symbol
#Locale
#MultiByteFileStream
#WeakArray
#FileStream
#FileLocator
#BasicCommandLineHandler
#NonInteractiveTranscript
#ASTCache
#OSEnvironment
#EndianDetector
#InternetConfiguration
#ZnServer
#MCGitHubRepository
#ZnLogEvent
#DisplayScreen
#InputEventSensor
#Cursor
#Form
#StrikeFont
#Color
#FreeTypeCache
#LogicalFont
#FT2Handle
#FreeTypeSettings
#WorldMorph
#CPUWatcher
#NOCCompletionTable
#Nautilus
#PharoCommonTools
#GTPlayBook
Also sensitive code could be the one using the session (Smalltalk session) to check if they need to free or reset some resources.

Thanks to have a look at it,
Christophe

I did some tests with AthensSceneView (uses NB and calls Smalltalk session for reinit external resources) and Roassal.
I got one image startup failure, but I couldn't reproduce it yet. Maybe I did image save and image save and quit, too quick.



Reply | Threaded
Open this post in threaded view
|

Re : Re: SessionManager (aka new startup / shutdown list manager) needs testers

demarey
In reply to this post by Aliaksei Syrel
Hi,

Indeed, I missed to update this one. À slice is in preparation.

Thanks

Reply | Threaded
Open this post in threaded view
|

Re : Re: SessionManager (aka new startup / shutdown list manager) needs testers

demarey
In reply to this post by Aliaksei Syrel
We do that because at startup, it is the startup ui manager that is used and we need to restore a usable one.
You could use a deferred startup action to set up a bloc ui manager.
How do you set the bloc ui manager for now?

----- Aliaksei Syrel <[hidden email]> a écrit :

> UIManagerSessionHandler>>#startup: isImageStarting
> "Install the right UIManager"
> UIManager default: UIManager forCurrentSystemConfiguration.
>
> Setting (overring current one) default UIManager each time image is
> saved/started up prevents us from having custom UIManagers, for example
> Bloc UI manager
>
> On Tue, Feb 2, 2016 at 7:04 PM, Aliaksei Syrel <[hidden email]> wrote:
>
> > When deleting a class I get deprecation in #50561 in
> > SystemDictionary>>#forgetClass: aClass logged: aBool  because
> > of removeFromStartUpList:
> >
> >
> > Cheers,
> > Alex
> >
> > On Sat, Dec 5, 2015 at 2:39 PM, Christophe Demarey <
> > [hidden email]> wrote:
> >
> >>
> >>
> >> ------------------------------
> >>
> >> *De: *"Nicolai Hess" <[hidden email]>
> >> *À: *"Pharo Development List" <[hidden email]>
> >> *Envoyé: *Vendredi 4 Décembre 2015 22:05:26
> >> *Objet: *Re: [Pharo-dev] SessionManager (aka new startup / shutdown list
> >> manager) needs testers
> >>
> >>
> >> Looks good. What are the main critical startup/shutdown users( classes)
> >> that should be tested?
> >>
> >> Classes using startup or/and shutdown are
> >>
> >> #SmallInteger
> >> #Delay atPriority
> >> #ProcessorScheduler
> >> #InputEventFetche
> >> #InputEventFetcher
> >> #OSPlatfor
> >> #Stdio
> >> #LanguageEnvironment
> >> #ShortIntegerArray
> >> #DiskStore
> >> #SmalltalkImage
> >> #WeakFinalizationList
> >> #Clipboard
> >> #MCMethodDefinition
> >> #Symbol
> >> #Locale
> >> #MultiByteFileStream
> >> #WeakArray
> >> #FileStream
> >> #FileLocator
> >> #BasicCommandLineHandler
> >> #NonInteractiveTranscript
> >> #ASTCache
> >> #OSEnvironment
> >> #EndianDetector
> >> #InternetConfiguration
> >> #ZnServer
> >> #MCGitHubRepository
> >> #ZnLogEvent
> >> #DisplayScreen
> >> #InputEventSensor
> >> #Cursor
> >> #Form
> >> #StrikeFont
> >> #Color
> >> #FreeTypeCache
> >> #LogicalFont
> >> #FT2Handle
> >> #FreeTypeSettings
> >> #WorldMorph
> >> #CPUWatcher
> >> #NOCCompletionTable
> >> #Nautilus
> >> #PharoCommonTools
> >> #GTPlayBook
> >>
> >> Also sensitive code could be the one using the session (Smalltalk
> >> session) to check if they need to free or reset some resources.
> >>
> >> Thanks to have a look at it,
> >> Christophe
> >>
> >>
> >> I did some tests with AthensSceneView (uses NB and calls Smalltalk
> >> session for reinit external resources) and Roassal.
> >> I got one image startup failure, but I couldn't reproduce it yet. Maybe I
> >> did image save and image save and quit, too quick.
> >>
> >>
> >


Reply | Threaded
Open this post in threaded view
|

Re: SessionManager (aka new startup / shutdown list manager) needs testers

Aliaksei Syrel
In reply to this post by Aliaksei Syrel
Bloc has its own UIManager, UI process, event fetchers and space/worlds. Because Bloc is not yet a default UI framework in pharo we want to switch to it manualy. To do this we have a world menu entry (switch to bloc). During switching process Bloc UIManager should become current default UIManager. Bloc's root model class is Universe. Universe can have multiple spaces where each space can have multiple worlds. For each space we assign its own UIManager with UI process, fetchers and so on to allow running multiple spaces in "<parallel>". To be able to switch between pharo morphic and bloc we have by default two running spaces: Bloc Space and Morphic Space. Each of them has its own UIManager: Bloc UI manager (new one) and Morphic UIManager (one that is in Pharo without Bloc being set during UIManagerSessionHandler>>#startup:).

In bloc, Space is responsible for starting and stopping itself (stopping listeners, stopping ui thread and so on). It means that Bloc UIManager can not exist without Bloc Space. (egg is Space, chicken is UIManager). 

We want users to be able to switch to bloc manually and allow to save image within the bloc to be able to get directly to it after startup.
(if user saves in morphic, after start up she gets to morphic. If she saves in bloc, after startup she gets to bloc).

My problem is the following method:

UIManagerSessionHandler>>#startup: isImageStarting
  "Install the right UIManager"
  UIManager default: UIManager forCurrentSystemConfiguration.

If there is a subclass of MorphicUIManager in the system, a subclass will be used as default UIManager. (due to forCurrentSystemConfiguration)
Now imagine I create a Bloc UIManager which is a subclass of MorphicUIManager. Bloc UI Manager as described above can not live without Bloc Space, because space controls ui manager. Even if I don't want to switch to bloc - Bloc UI Manager will be used by default, which leads to NullPointerException (space is undefined).

Now Imagine that we just load Bloc as part of build process. During first image start forCurrentSystemConfiguration selects BlocUIManager and image crashes.

I see that something is broken. Let's find out what and where. And fix asap!

Cheers,
Alex

On Tue, Feb 2, 2016 at 7:31 PM, Aliaksei Syrel <[hidden email]> wrote:
UIManagerSessionHandler>>#startup: isImageStarting
"Install the right UIManager"
UIManager default: UIManager forCurrentSystemConfiguration.

Setting (overring current one) default UIManager each time image is saved/started up prevents us from having custom UIManagers, for example Bloc UI manager

On Tue, Feb 2, 2016 at 7:04 PM, Aliaksei Syrel <[hidden email]> wrote:
When deleting a class I get deprecation in #50561 in SystemDictionary>>#forgetClass: aClass logged: aBool  because of removeFromStartUpList:


Cheers,
Alex

On Sat, Dec 5, 2015 at 2:39 PM, Christophe Demarey <[hidden email]> wrote:



De: "Nicolai Hess" <[hidden email]>
À: "Pharo Development List" <[hidden email]>
Envoyé: Vendredi 4 Décembre 2015 22:05:26
Objet: Re: [Pharo-dev] SessionManager (aka new startup / shutdown list manager) needs testers


Looks good. What are the main critical startup/shutdown users( classes) that should be tested?
Classes using startup or/and shutdown are
#SmallInteger
#Delay atPriority
#ProcessorScheduler
#InputEventFetche
#InputEventFetcher
#OSPlatfor
#Stdio
#LanguageEnvironment
#ShortIntegerArray
#DiskStore
#SmalltalkImage
#WeakFinalizationList
#Clipboard
#MCMethodDefinition
#Symbol
#Locale
#MultiByteFileStream
#WeakArray
#FileStream
#FileLocator
#BasicCommandLineHandler
#NonInteractiveTranscript
#ASTCache
#OSEnvironment
#EndianDetector
#InternetConfiguration
#ZnServer
#MCGitHubRepository
#ZnLogEvent
#DisplayScreen
#InputEventSensor
#Cursor
#Form
#StrikeFont
#Color
#FreeTypeCache
#LogicalFont
#FT2Handle
#FreeTypeSettings
#WorldMorph
#CPUWatcher
#NOCCompletionTable
#Nautilus
#PharoCommonTools
#GTPlayBook
Also sensitive code could be the one using the session (Smalltalk session) to check if they need to free or reset some resources.

Thanks to have a look at it,
Christophe

I did some tests with AthensSceneView (uses NB and calls Smalltalk session for reinit external resources) and Roassal.
I got one image startup failure, but I couldn't reproduce it yet. Maybe I did image save and image save and quit, too quick.




Reply | Threaded
Open this post in threaded view
|

Re: SessionManager (aka new startup / shutdown list manager) needs testers

Ben Coman
On Thu, Feb 4, 2016 at 5:06 AM, Aliaksei Syrel <[hidden email]> wrote:

> Bloc has its own UIManager, UI process, event fetchers and space/worlds.
> Because Bloc is not yet a default UI framework in pharo we want to switch to
> it manualy. To do this we have a world menu entry (switch to bloc). During
> switching process Bloc UIManager should become current default UIManager.
> Bloc's root model class is Universe. Universe can have multiple spaces where
> each space can have multiple worlds. For each space we assign its own
> UIManager with UI process, fetchers and so on to allow running multiple
> spaces in "<parallel>". To be able to switch between pharo morphic and bloc
> we have by default two running spaces: Bloc Space and Morphic Space. Each of
> them has its own UIManager: Bloc UI manager (new one) and Morphic UIManager
> (one that is in Pharo without Bloc being set during
> UIManagerSessionHandler>>#startup:).

Thanks for that description Aex.  I haven't seen much doc on the Bloc
architecture, so it is interesting hear of this Universe part.
I wonder... even if Bloc is not yet ready for prime time default use,
how ready is the Universe sub-part?
Could this part be enabled by default prior to the rest of Bloc being
ready for default? and would that help your case?

Further along that line of thought, considering the
modularisation/minimalisation effort, is it possible the Universe part
could be completely separated from Bloc, so we could (for
demonstration only) have only Universe+Morphic, but also later if
someone was to resurrect MVC, we could be have only Universe+MVC, or
only...
* Universe+RemoteUI
* Universe+Headless
* Universe+CommandLineREPL
* Universe+EmergencyUI
* Universe+SomeOtherExperiment

Or is Universe not an appropriate container for those sorts of things?

cheers -ben


>
> In bloc, Space is responsible for starting and stopping itself (stopping
> listeners, stopping ui thread and so on). It means that Bloc UIManager can
> not exist without Bloc Space. (egg is Space, chicken is UIManager).
>
> We want users to be able to switch to bloc manually and allow to save image
> within the bloc to be able to get directly to it after startup.
> (if user saves in morphic, after start up she gets to morphic. If she saves
> in bloc, after startup she gets to bloc).
>
> My problem is the following method:
>
>> UIManagerSessionHandler>>#startup: isImageStarting
>>   "Install the right UIManager"
>>   UIManager default: UIManager forCurrentSystemConfiguration.
>
>
> If there is a subclass of MorphicUIManager in the system, a subclass will be
> used as default UIManager. (due to forCurrentSystemConfiguration)
> Now imagine I create a Bloc UIManager which is a subclass of
> MorphicUIManager. Bloc UI Manager as described above can not live without
> Bloc Space, because space controls ui manager. Even if I don't want to
> switch to bloc - Bloc UI Manager will be used by default, which leads to
> NullPointerException (space is undefined).
>
> Now Imagine that we just load Bloc as part of build process. During first
> image start forCurrentSystemConfiguration selects BlocUIManager and image
> crashes.
>
> I see that something is broken. Let's find out what and where. And fix asap!
>
> Cheers,
> Alex
>
> On Tue, Feb 2, 2016 at 7:31 PM, Aliaksei Syrel <[hidden email]> wrote:
>>
>> UIManagerSessionHandler>>#startup: isImageStarting
>> "Install the right UIManager"
>> UIManager default: UIManager forCurrentSystemConfiguration.
>>
>> Setting (overring current one) default UIManager each time image is
>> saved/started up prevents us from having custom UIManagers, for example Bloc
>> UI manager
>>
>> On Tue, Feb 2, 2016 at 7:04 PM, Aliaksei Syrel <[hidden email]>
>> wrote:
>>>
>>> When deleting a class I get deprecation in #50561 in
>>> SystemDictionary>>#forgetClass: aClass logged: aBool  because of
>>> removeFromStartUpList:
>>>
>>>
>>> Cheers,
>>> Alex

Reply | Threaded
Open this post in threaded view
|

Re: SessionManager (aka new startup / shutdown list manager) needs testers

Guillermo Polito
Hi Alex,

First, note that the current UIManager selection and the
StartupUIManager appears from a cleanup on the old UIManager selection
that existed. The idea is that the UIManagerSessionHandler will run in
low priority and set a startup UIManager during startup (when you cannot
ensure that UI is still operational) and then replace it by a default
UIManager to keep backwards compatibility for now. But, Block can have
its own startup action that installs it's own world/UIManager in a
higher priority than the startup. Is this a possibility? Of course I
think morphic should do the same: it should have a startup action that
initiates a UI thread, and a corresponding UImanager. But we did not
attack that refactor yet, :). We should be able to explicitly recreate
the UI process on each startup.

Then, a second problem is having a different UIManager for each
World/Universe, and have co-existing Morphic/Block or even different
Block universes. Today's UIManager is global and shared by everybody, as
it always was and it never took into account the multiple world
possibility...

So, any proposal in this direction would be nice!

On 02/04/2016 01:17 AM, Ben Coman wrote:

> On Thu, Feb 4, 2016 at 5:06 AM, Aliaksei Syrel <[hidden email]> wrote:
>> Bloc has its own UIManager, UI process, event fetchers and space/worlds.
>> Because Bloc is not yet a default UI framework in pharo we want to switch to
>> it manualy. To do this we have a world menu entry (switch to bloc). During
>> switching process Bloc UIManager should become current default UIManager.
>> Bloc's root model class is Universe. Universe can have multiple spaces where
>> each space can have multiple worlds. For each space we assign its own
>> UIManager with UI process, fetchers and so on to allow running multiple
>> spaces in "<parallel>". To be able to switch between pharo morphic and bloc
>> we have by default two running spaces: Bloc Space and Morphic Space. Each of
>> them has its own UIManager: Bloc UI manager (new one) and Morphic UIManager
>> (one that is in Pharo without Bloc being set during
>> UIManagerSessionHandler>>#startup:).
> Thanks for that description Aex.  I haven't seen much doc on the Bloc
> architecture, so it is interesting hear of this Universe part.
> I wonder... even if Bloc is not yet ready for prime time default use,
> how ready is the Universe sub-part?
> Could this part be enabled by default prior to the rest of Bloc being
> ready for default? and would that help your case?
>
> Further along that line of thought, considering the
> modularisation/minimalisation effort, is it possible the Universe part
> could be completely separated from Bloc, so we could (for
> demonstration only) have only Universe+Morphic, but also later if
> someone was to resurrect MVC, we could be have only Universe+MVC, or
> only...
> * Universe+RemoteUI
> * Universe+Headless
> * Universe+CommandLineREPL
> * Universe+EmergencyUI
> * Universe+SomeOtherExperiment
>
> Or is Universe not an appropriate container for those sorts of things?
>
> cheers -ben
>
>
>> In bloc, Space is responsible for starting and stopping itself (stopping
>> listeners, stopping ui thread and so on). It means that Bloc UIManager can
>> not exist without Bloc Space. (egg is Space, chicken is UIManager).
>>
>> We want users to be able to switch to bloc manually and allow to save image
>> within the bloc to be able to get directly to it after startup.
>> (if user saves in morphic, after start up she gets to morphic. If she saves
>> in bloc, after startup she gets to bloc).
>>
>> My problem is the following method:
>>
>>> UIManagerSessionHandler>>#startup: isImageStarting
>>>    "Install the right UIManager"
>>>    UIManager default: UIManager forCurrentSystemConfiguration.
>>
>> If there is a subclass of MorphicUIManager in the system, a subclass will be
>> used as default UIManager. (due to forCurrentSystemConfiguration)
>> Now imagine I create a Bloc UIManager which is a subclass of
>> MorphicUIManager. Bloc UI Manager as described above can not live without
>> Bloc Space, because space controls ui manager. Even if I don't want to
>> switch to bloc - Bloc UI Manager will be used by default, which leads to
>> NullPointerException (space is undefined).
>>
>> Now Imagine that we just load Bloc as part of build process. During first
>> image start forCurrentSystemConfiguration selects BlocUIManager and image
>> crashes.
>>
>> I see that something is broken. Let's find out what and where. And fix asap!
>>
>> Cheers,
>> Alex
>>
>> On Tue, Feb 2, 2016 at 7:31 PM, Aliaksei Syrel <[hidden email]> wrote:
>>> UIManagerSessionHandler>>#startup: isImageStarting
>>> "Install the right UIManager"
>>> UIManager default: UIManager forCurrentSystemConfiguration.
>>>
>>> Setting (overring current one) default UIManager each time image is
>>> saved/started up prevents us from having custom UIManagers, for example Bloc
>>> UI manager
>>>
>>> On Tue, Feb 2, 2016 at 7:04 PM, Aliaksei Syrel <[hidden email]>
>>> wrote:
>>>> When deleting a class I get deprecation in #50561 in
>>>> SystemDictionary>>#forgetClass: aClass logged: aBool  because of
>>>> removeFromStartUpList:
>>>>
>>>>
>>>> Cheers,
>>>> Alex


Reply | Threaded
Open this post in threaded view
|

Re: SessionManager (aka new startup / shutdown list manager) needs testers

demarey
Hi Alex,

Thanks for your detailed explanation.
To me,the design of the current UIManger is not good enough. UIManager has too much pre-occupations. He is in charge of:
  • providing different implementation of interactive requests, depending if the current UI manager is interactive or not, if the UI is available or not,
  • provide different way of handling errors, still depending on the interactive/UI status,
  • initialize the current UI.
At some point we should split that but it another story.

For your use case, I think the only behavior missing for you from the old startup mechanism is a way to have both morphic and bloc available in the image and to stop an image and start with the ui manager in place at shutdown (the user can switch from Morphic to bloc and vice-versa).
It think it is a valid use case and we could add a state to the startup ui manager to hold the value of the default ui manager. This way, we can restore it when we deinstall the startup ui manager.

WDYT?

Cheers,
Christophe

Le 4 févr. 2016 à 09:48, Guille Polito a écrit :

Hi Alex,

First, note that the current UIManager selection and the StartupUIManager appears from a cleanup on the old UIManager selection that existed. The idea is that the UIManagerSessionHandler will run in low priority and set a startup UIManager during startup (when you cannot ensure that UI is still operational) and then replace it by a default UIManager to keep backwards compatibility for now. But, Block can have its own startup action that installs it's own world/UIManager in a higher priority than the startup. Is this a possibility? Of course I think morphic should do the same: it should have a startup action that initiates a UI thread, and a corresponding UImanager. But we did not attack that refactor yet, :). We should be able to explicitly recreate the UI process on each startup.

Then, a second problem is having a different UIManager for each World/Universe, and have co-existing Morphic/Block or even different Block universes. Today's UIManager is global and shared by everybody, as it always was and it never took into account the multiple world possibility...

So, any proposal in this direction would be nice!

On 02/04/2016 01:17 AM, Ben Coman wrote:
On Thu, Feb 4, 2016 at 5:06 AM, Aliaksei Syrel <[hidden email]> wrote:
Bloc has its own UIManager, UI process, event fetchers and space/worlds.
Because Bloc is not yet a default UI framework in pharo we want to switch to
it manualy. To do this we have a world menu entry (switch to bloc). During
switching process Bloc UIManager should become current default UIManager.
Bloc's root model class is Universe. Universe can have multiple spaces where
each space can have multiple worlds. For each space we assign its own
UIManager with UI process, fetchers and so on to allow running multiple
spaces in "<parallel>". To be able to switch between pharo morphic and bloc
we have by default two running spaces: Bloc Space and Morphic Space. Each of
them has its own UIManager: Bloc UI manager (new one) and Morphic UIManager
(one that is in Pharo without Bloc being set during
UIManagerSessionHandler>>#startup:).
Thanks for that description Aex.  I haven't seen much doc on the Bloc
architecture, so it is interesting hear of this Universe part.
I wonder... even if Bloc is not yet ready for prime time default use,
how ready is the Universe sub-part?
Could this part be enabled by default prior to the rest of Bloc being
ready for default? and would that help your case?

Further along that line of thought, considering the
modularisation/minimalisation effort, is it possible the Universe part
could be completely separated from Bloc, so we could (for
demonstration only) have only Universe+Morphic, but also later if
someone was to resurrect MVC, we could be have only Universe+MVC, or
only...
* Universe+RemoteUI
* Universe+Headless
* Universe+CommandLineREPL
* Universe+EmergencyUI
* Universe+SomeOtherExperiment

Or is Universe not an appropriate container for those sorts of things?

cheers -ben


In bloc, Space is responsible for starting and stopping itself (stopping
listeners, stopping ui thread and so on). It means that Bloc UIManager can
not exist without Bloc Space. (egg is Space, chicken is UIManager).

We want users to be able to switch to bloc manually and allow to save image
within the bloc to be able to get directly to it after startup.
(if user saves in morphic, after start up she gets to morphic. If she saves
in bloc, after startup she gets to bloc).

My problem is the following method:

UIManagerSessionHandler>>#startup: isImageStarting
  "Install the right UIManager"
  UIManager default: UIManager forCurrentSystemConfiguration.

If there is a subclass of MorphicUIManager in the system, a subclass will be
used as default UIManager. (due to forCurrentSystemConfiguration)
Now imagine I create a Bloc UIManager which is a subclass of
MorphicUIManager. Bloc UI Manager as described above can not live without
Bloc Space, because space controls ui manager. Even if I don't want to
switch to bloc - Bloc UI Manager will be used by default, which leads to
NullPointerException (space is undefined).

Now Imagine that we just load Bloc as part of build process. During first
image start forCurrentSystemConfiguration selects BlocUIManager and image
crashes.

I see that something is broken. Let's find out what and where. And fix asap!

Cheers,
Alex

On Tue, Feb 2, 2016 at 7:31 PM, Aliaksei Syrel <[hidden email]> wrote:
UIManagerSessionHandler>>#startup: isImageStarting
"Install the right UIManager"
UIManager default: UIManager forCurrentSystemConfiguration.

Setting (overring current one) default UIManager each time image is
saved/started up prevents us from having custom UIManagers, for example Bloc
UI manager

On Tue, Feb 2, 2016 at 7:04 PM, Aliaksei Syrel <[hidden email]>
wrote:
When deleting a class I get deprecation in #50561 in
SystemDictionary>>#forgetClass: aClass logged: aBool  because of
removeFromStartUpList:


Cheers,
Alex



Reply | Threaded
Open this post in threaded view
|

Re: SessionManager (aka new startup / shutdown list manager) needs testers

Guillermo Polito
In reply to this post by Ben Coman
Hi Alex,

First, note that the current UIManager selection and the
StartupUIManager appears from a cleanup on the old UIManager selection
that existed. The idea is that the UIManagerSessionHandler will run in
low priority and set a startup UIManager during startup (when you cannot
ensure that UI is still operational) and then replace it by a default
UIManager to keep backwards compatibility for now. But, Block can have
its own startup action that installs it's own world/UIManager in a
higher priority than the startup. Is this a possibility? Of course I
think morphic should do the same: it should have a startup action that
initiates a UI thread, and a corresponding UImanager. But we did not
attack that refactor yet, :). We should be able to explicitly recreate
the UI process on each startup.

Then, a second problem is having a different UIManager for each
World/Universe, and have co-existing Morphic/Block or even different
Block universes. Today's UIManager is global and shared by everybody, as
it always was and it never took into account the multiple world
possibility...

So, any proposal in this direction would be nice!

On 02/04/2016 01:17 AM, Ben Coman wrote:

> On Thu, Feb 4, 2016 at 5:06 AM, Aliaksei Syrel <[hidden email]> wrote:
>> Bloc has its own UIManager, UI process, event fetchers and space/worlds.
>> Because Bloc is not yet a default UI framework in pharo we want to switch to
>> it manualy. To do this we have a world menu entry (switch to bloc). During
>> switching process Bloc UIManager should become current default UIManager.
>> Bloc's root model class is Universe. Universe can have multiple spaces where
>> each space can have multiple worlds. For each space we assign its own
>> UIManager with UI process, fetchers and so on to allow running multiple
>> spaces in "<parallel>". To be able to switch between pharo morphic and bloc
>> we have by default two running spaces: Bloc Space and Morphic Space. Each of
>> them has its own UIManager: Bloc UI manager (new one) and Morphic UIManager
>> (one that is in Pharo without Bloc being set during
>> UIManagerSessionHandler>>#startup:).
> Thanks for that description Aex.  I haven't seen much doc on the Bloc
> architecture, so it is interesting hear of this Universe part.
> I wonder... even if Bloc is not yet ready for prime time default use,
> how ready is the Universe sub-part?
> Could this part be enabled by default prior to the rest of Bloc being
> ready for default? and would that help your case?
>
> Further along that line of thought, considering the
> modularisation/minimalisation effort, is it possible the Universe part
> could be completely separated from Bloc, so we could (for
> demonstration only) have only Universe+Morphic, but also later if
> someone was to resurrect MVC, we could be have only Universe+MVC, or
> only...
> * Universe+RemoteUI
> * Universe+Headless
> * Universe+CommandLineREPL
> * Universe+EmergencyUI
> * Universe+SomeOtherExperiment
>
> Or is Universe not an appropriate container for those sorts of things?
>
> cheers -ben
>
>
>> In bloc, Space is responsible for starting and stopping itself (stopping
>> listeners, stopping ui thread and so on). It means that Bloc UIManager can
>> not exist without Bloc Space. (egg is Space, chicken is UIManager).
>>
>> We want users to be able to switch to bloc manually and allow to save image
>> within the bloc to be able to get directly to it after startup.
>> (if user saves in morphic, after start up she gets to morphic. If she saves
>> in bloc, after startup she gets to bloc).
>>
>> My problem is the following method:
>>
>>> UIManagerSessionHandler>>#startup: isImageStarting
>>>    "Install the right UIManager"
>>>    UIManager default: UIManager forCurrentSystemConfiguration.
>> If there is a subclass of MorphicUIManager in the system, a subclass will be
>> used as default UIManager. (due to forCurrentSystemConfiguration)
>> Now imagine I create a Bloc UIManager which is a subclass of
>> MorphicUIManager. Bloc UI Manager as described above can not live without
>> Bloc Space, because space controls ui manager. Even if I don't want to
>> switch to bloc - Bloc UI Manager will be used by default, which leads to
>> NullPointerException (space is undefined).
>>
>> Now Imagine that we just load Bloc as part of build process. During first
>> image start forCurrentSystemConfiguration selects BlocUIManager and image
>> crashes.
>>
>> I see that something is broken. Let's find out what and where. And fix asap!
>>
>> Cheers,
>> Alex
>>
>> On Tue, Feb 2, 2016 at 7:31 PM, Aliaksei Syrel <[hidden email]> wrote:
>>> UIManagerSessionHandler>>#startup: isImageStarting
>>> "Install the right UIManager"
>>> UIManager default: UIManager forCurrentSystemConfiguration.
>>>
>>> Setting (overring current one) default UIManager each time image is
>>> saved/started up prevents us from having custom UIManagers, for example Bloc
>>> UI manager
>>>
>>> On Tue, Feb 2, 2016 at 7:04 PM, Aliaksei Syrel <[hidden email]>
>>> wrote:
>>>> When deleting a class I get deprecation in #50561 in
>>>> SystemDictionary>>#forgetClass: aClass logged: aBool  because of
>>>> removeFromStartUpList:
>>>>
>>>>
>>>> Cheers,
>>>> Alex


Reply | Threaded
Open this post in threaded view
|

Re: SessionManager (aka new startup / shutdown list manager) needs testers

Aliaksei Syrel
In reply to this post by demarey
Hi Christophe

Thanks for the answer :)
What you proposed indeed fixes the issue. it would be great to have it!

Because Bloc Universe knows which space is currently running I can detect which UI manager is needed. So I just hacked "new" in bloc ui manager:

new
  ^ super new space: (%ask universe for correct space%)

Ugly but works, until refactoring of SessionManager is done.

Please continue your great job :) 


Cheers,
Alex
Reply | Threaded
Open this post in threaded view
|

Re: SessionManager (aka new startup / shutdown list manager) needs testers

demarey
Hi Alex,

I just publish a configuration of the Session Manager with this change (not yet in Pharo).
Please could you test if it is ok for you?

you can load it with:
Metacello new
	smalltalkhubUser: 'Pharo' project: 'SessionManager';
	configuration: 'SessionManager';
	fetch.
Metacello new
	smalltalkhubUser: 'Pharo' project: 'SessionManager';
	configuration: 'SessionManager';
	version: '1.7';
	load
Cheers,
Christophe


Le 4 févr. 2016 à 13:42, Aliaksei Syrel <[hidden email]> a écrit :

Hi Christophe

Thanks for the answer :)
What you proposed indeed fixes the issue. it would be great to have it!

Because Bloc Universe knows which space is currently running I can detect which UI manager is needed. So I just hacked "new" in bloc ui manager:

new
  ^ super new space: (%ask universe for correct space%)

Ugly but works, until refactoring of SessionManager is done.

Please continue your great job :) 


Cheers,
Alex