Issue with the --headless option on Windows 10

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

Issue with the --headless option on Windows 10

Sven Van Caekenberghe-2
Hi,

User Herby Vojčík seems to have an issue with the --headless option on Windows 10

https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used

I cannot reproduce his problem.

Maybe there are Windows users out there who can have a look and help him ?

Thx,

Sven


Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

CyrilFerlicot
Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :

> Hi,
>
> User Herby Vojčík seems to have an issue with the --headless option on Windows 10
>
> https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>
> I cannot reproduce his problem.
>
> Maybe there are Windows users out there who can have a look and help him ?
>
> Thx,
>
> Sven
>
>
Hi,

I am not sure but I think that in Windows the option to use is not
--headless but --nodisplay.

--
Cyril Ferlicot
https://ferlicot.fr

http://www.synectique.eu
2 rue Jacques Prévert 01,
59650 Villeneuve d'ascq France


signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

Herby Vojčík
In reply to this post by Sven Van Caekenberghe-2
Sven Van Caekenberghe wrote:

> Hi,
>
> User Herby Vojčík seems to have an issue with the --headless option on Windows 10
>
> https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>
> I cannot reproduce his problem.
>
> Maybe there are Windows users out there who can have a look and help him ?
>
> Thx,
>
> Sven
>
>
But from the PharoDebug.log I sent to the issue (and send here as you
wanted to continue discussion here) it should be clear self isRunning
wasn't false, even if both process and serverSocket are shown as nil.

Very strange.

Somewhere between headless W10 shutdown and W10 ui startup something
must be broken that made Zinc unregister the running and registered server.

Herby

PharoDebug.log (16K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

Herby Vojčík
In reply to this post by Sven Van Caekenberghe-2
Sven Van Caekenberghe wrote:

> Hi,
>
> User Herby Vojčík seems to have an issue with the --headless option on Windows 10
>
> https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>
> I cannot reproduce his problem.
>
> Maybe there are Windows users out there who can have a look and help him ?
>
> Thx,
>
> Sven
>
>
I changed ZnSingleThreadedServer >> stop: to this:

stop: unregister
        "Stop me. I will stop listening on my port for incoming HTTP connections.
        If unregister is true, unregister me from the list of managed instances.
        Does nothing when I am not running"
       
        self isRunning ifFalse: [ ^ self ].
        unregister ifTrue: [ Error signal: 'stop: true was sent to running
server!' ].
        process terminate.
        process := nil.
        unregister ifTrue: [ self unregister ].
        self closeDelegate.
        self logStopped

As a result, different PharoDebug.log was generated (only in headless
case, of course), which shows the server was indeed saved with both
process and serverSocket being notNil.

Attached.

Herby

PharoDebug.log (43K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

Sven Van Caekenberghe-2
In reply to this post by CyrilFerlicot

> On 25 Jul 2017, at 19:46, Cyril Ferlicot D. <[hidden email]> wrote:
>
> Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
>> Hi,
>>
>> User Herby Vojčík seems to have an issue with the --headless option on Windows 10
>>
>> https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>>
>> I cannot reproduce his problem.
>>
>> Maybe there are Windows users out there who can have a look and help him ?

Anyone ?

>> Thx,
>>
>> Sven
>>
>>
>
> Hi,
>
> I am not sure but I think that in Windows the option to use is not
> --headless but --nodisplay.

I just tried a bit using Pharo 6.1 on Windows 10 in command line mode (Command Prompt). It seems that apart from starting an image (and executing a .st file) not much else works. I can't get any of the normal Pharo command line handling to work, it feels as if none of the VM flags have any effect. Output is only written to a file. The windows with the World always opens. I can't see a difference between Pharo.exe and PharoConsole.exe

Even the simplest thing like

  Pharo.exe Pharo.image eval '1+2'

Doesn't work as expected.

Quite unusable.

Maybe this is not supposed to work ?

Can anyone help a bit here ?

> --
> Cyril Ferlicot
> https://ferlicot.fr
>
> http://www.synectique.eu
> 2 rue Jacques Prévert 01,
> 59650 Villeneuve d'ascq France
>


Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

Nicolai Hess-3-2


2017-07-26 11:53 GMT+02:00 Sven Van Caekenberghe <[hidden email]>:

> On 25 Jul 2017, at 19:46, Cyril Ferlicot D. <[hidden email]> wrote:
>
> Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
>> Hi,
>>
>> User Herby Vojčík seems to have an issue with the --headless option on Windows 10
>>
>> https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>>
>> I cannot reproduce his problem.
>>
>> Maybe there are Windows users out there who can have a look and help him ?

Anyone ?

>> Thx,
>>
>> Sven
>>
>>
>
> Hi,
>
> I am not sure but I think that in Windows the option to use is not
> --headless but --nodisplay.

I just tried a bit using Pharo 6.1 on Windows 10 in command line mode (Command Prompt). It seems that apart from starting an image (and executing a .st file) not much else works. I can't get any of the normal Pharo command line handling to work, it feels as if none of the VM flags have any effect. Output is only written to a file. The windows with the World always opens. I can't see a difference between Pharo.exe and PharoConsole.exe

Even the simplest thing like

  Pharo.exe Pharo.image eval '1+2'

Doesn't work as expected.

Quite unusable.

Maybe this is not supposed to work ?

Can anyone help a bit here ?

I can not test Windows 10 at the moment, but on windows 7

pharo --headless Pharo6.1.image eval "DateAndTime now"

Works, no window opens, and it puts the output of the evaluation in a stdout-file.




 

> --
> Cyril Ferlicot
> https://ferlicot.fr
>
> http://www.synectique.eu
> 2 rue Jacques Prévert 01,
> 59650 Villeneuve d'ascq France
>



Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

Herby Vojčík
In reply to this post by Sven Van Caekenberghe-2


On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe <[hidden email]> wrote:

>
>> On 25 Jul 2017, at 19:46, Cyril Ferlicot D.
><[hidden email]> wrote:
>>
>> Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
>>> Hi,
>>>
>>> User Herby Vojčík seems to have an issue with the --headless option
>on Windows 10
>>>
>>>
>https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>>>
>>> I cannot reproduce his problem.
>>>
>>> Maybe there are Windows users out there who can have a look and help
>him ?
>
>Anyone ?
>
>>> Thx,
>>>
>>> Sven
>>>
>>>
>>
>> Hi,
>>
>> I am not sure but I think that in Windows the option to use is not
>> --headless but --nodisplay.
>
>I just tried a bit using Pharo 6.1 on Windows 10 in command line mode
>(Command Prompt). It seems that apart from starting an image (and
>executing a .st file) not much else works. I can't get any of the
>normal Pharo command line handling to work, it feels as if none of the

  get CatalogName works (at least it did on 6.0, I don't need it my scripts any more)
  update works
  save works
  eval worked in 6.0 (I moved to st scripts though before switching to 6.1) but needed to contain save:and quit: send

>VM flags have any effect. Output is only written to a file. The windows

  --headless has an effect, it runs headless. And with different outcomes sometimes, as this issue shows

>with the World always opens. I can't see a difference between Pharo.exe
>and PharoConsole.exe

Console output is to dedicated window with pharoconsole, not to ui element.

>Even the simplest thing like
>
>  Pharo.exe Pharo.image eval '1+2'
>
>Doesn't work as expected.
>
>Quite unusable.
>
>Maybe this is not supposed to work ?

This is ridiculous claim. Everything actually works as expected when --headless not used. Only when used, it behaves strange and saves running servers.

Also, are you trying to tell Pharo treats Windows as tier two platform (I had the impression it does not, despite not having 64 bit yet)? To the point that 32bit version does not do --headless right and saves wrong image and "it is supposed to be that way"?

Herby

>Can anyone help a bit here ?
>
>> --
>> Cyril Ferlicot
>> https://ferlicot.fr
>>
>> http://www.synectique.eu
>> 2 rue Jacques Prévert 01,
>> 59650 Villeneuve d'ascq France
>>

Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

Nicolai Hess-3-2


2017-07-26 12:09 GMT+02:00 <[hidden email]>:


On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe <[hidden email]> wrote:
>
>> On 25 Jul 2017, at 19:46, Cyril Ferlicot D.
><[hidden email]> wrote:
>>
>> Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
>>> Hi,
>>>
>>> User Herby Vojčík seems to have an issue with the --headless option
>on Windows 10
>>>
>>>
>https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>>>
>>> I cannot reproduce his problem.
>>>
>>> Maybe there are Windows users out there who can have a look and help
>him ?
>
>Anyone ?
>

I can reproduce the strange output:

pharo --headless Pharo.image st sample.st

with sample.st contains

(ZnServer startOn: 8888) register.
Smalltalk snapshot: true andQuit: true.

Now starting the pharo image in gui mode

pharo --headless Pharo.image

I can access localhost:8888

but
ZnServer managedServers evaluates to "an IdentitySet()"

running

pharo --headless Pharo.image eval "ZnServer managedServers" shows
an IdentitySet(a ZnManagingMultiThreadedServer(stopped 8888))

running eval without headless option:

pharo Pharo.image eval "ZnServer managedServers"
the set is again empty:
an IdentitySet()


Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

Herby Vojčík
Nicolai Hess wrote:

>
>
> 2017-07-26 12:09 GMT+02:00 <[hidden email] <mailto:[hidden email]>>:
>
>
>
>     On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe
>     <[hidden email] <mailto:[hidden email]>> wrote:
>     >
>     > > On 25 Jul 2017, at 19:46, Cyril Ferlicot D.
>     ><[hidden email] <mailto:[hidden email]>> wrote:
>     > >
>     > > Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
>     > >> Hi,
>     > >>
>     > >> User Herby Vojčík seems to have an issue with the --headless option
>     >on Windows 10
>     > >>
>     > >>
>     >https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>     <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used>
>     > >>
>     > >> I cannot reproduce his problem.
>     > >>
>     > >> Maybe there are Windows users out there who can have a look and help
>     >him ?
>     >
>     >Anyone ?
>     >
>
>
> I can reproduce the strange output:
>
> pharo --headless Pharo.image st sample.st <http://sample.st>
>
> with sample.st <http://sample.st> contains
>
> (ZnServer startOn: 8888) register.
> Smalltalk snapshot: true andQuit: true.
>
> Now starting the pharo image in gui mode
>
> pharo --headless Pharo.image

This should probably be without --headless to be less strange (running
in gui mode does not need --headless, if --headless starts gui without
cli args in Win, that is probably another issue that should be raised
for win vm)

> I can access localhost:8888
>
> but
> ZnServer managedServers evaluates to "an IdentitySet()"
>
> running
>
> pharo --headless Pharo.image eval "ZnServer managedServers" shows
> an IdentitySet(a ZnManagingMultiThreadedServer(stopped 8888))

Wow, it did not come to my mind to check that. That means it is indeed
the headless to gui transition that is problematic as headless to
headless is fine.

> running eval without headless option:
>
> pharo Pharo.image eval "ZnServer managedServers"
> the set is again empty:
> an IdentitySet()
>
>

Thanks, Herby

Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

Nicolai Hess-3-2


2017-07-26 13:08 GMT+02:00 Herby Vojčík <[hidden email]>:
Nicolai Hess wrote:


2017-07-26 12:09 GMT+02:00 <[hidden email] <mailto:[hidden email]>>:



    On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe
    <[hidden email] <mailto:[hidden email]>> wrote:
    >
    > > On 25 Jul 2017, at 19:46, Cyril Ferlicot D.
    ><[hidden email] <mailto:[hidden email]>> wrote:
    > >
    > > Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
    > >> Hi,
    > >>
    > >> User Herby Vojčík seems to have an issue with the --headless option
    >on Windows 10
    > >>
    > >>
    >https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
    <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used>
    > >>
    > >> I cannot reproduce his problem.
    > >>
    > >> Maybe there are Windows users out there who can have a look and help
    >him ?
    >
    >Anyone ?
    >


I can reproduce the strange output:

pharo --headless Pharo.image st sample.st <http://sample.st>

with sample.st <http://sample.st> contains

(ZnServer startOn: 8888) register.
Smalltalk snapshot: true andQuit: true.

Now starting the pharo image in gui mode

pharo --headless Pharo.image

This should probably be without --headless to be less strange (running in gui mode does not need --headless, if --headless starts gui without cli args in Win, that is probably another issue that should be raised for win vm)

Oh, yes of course, I meant running
pharo Pharo.image
 

I can access localhost:8888

but
ZnServer managedServers evaluates to "an IdentitySet()"

running

pharo --headless Pharo.image eval "ZnServer managedServers" shows
an IdentitySet(a ZnManagingMultiThreadedServer(stopped 8888))

Wow, it did not come to my mind to check that. That means it is indeed the headless to gui transition that is problematic as headless to headless is fine.

running eval without headless option:

pharo Pharo.image eval "ZnServer managedServers"
the set is again empty:
an IdentitySet()



Thanks, Herby


It lools like ZnServer resets the ManagedServers variable, if the image starts without the headless option.

Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

Herby Vojčík
Nicolai Hess wrote:

>
>
> 2017-07-26 13:08 GMT+02:00 Herby Vojčík <[hidden email]
> <mailto:[hidden email]>>:
>
>     Nicolai Hess wrote:
>
>
>
>         2017-07-26 12:09 GMT+02:00 <[hidden email]
>         <mailto:[hidden email]> <mailto:[hidden email]
>         <mailto:[hidden email]>>>:
>
>
>
>              On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe
>         <[hidden email] <mailto:[hidden email]> <mailto:[hidden email]
>         <mailto:[hidden email]>>> wrote:
>         >
>         >  > On 25 Jul 2017, at 19:46, Cyril Ferlicot D.
>         ><[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>> wrote:
>         >  >
>         >  > Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
>         >  >> Hi,
>         >  >>
>         >  >> User Herby Vojčík seems to have an issue with the
>         --headless option
>         >on Windows 10
>         >  >>
>         >  >>
>         >https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>         <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used>
>         <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>         <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used>>
>         >  >>
>         >  >> I cannot reproduce his problem.
>         >  >>
>         >  >> Maybe there are Windows users out there who can have a look
>         and help
>         >him ?
>         >
>         >Anyone ?
>         >
>
>
>         I can reproduce the strange output:
>
>         pharo --headless Pharo.image st sample.st <http://sample.st>
>         <http://sample.st>
>
>         with sample.st <http://sample.st> <http://sample.st> contains
>
>         (ZnServer startOn: 8888) register.
>         Smalltalk snapshot: true andQuit: true.
>
>         Now starting the pharo image in gui mode
>
>         pharo --headless Pharo.image
>
>
>     This should probably be without --headless to be less strange
>     (running in gui mode does not need --headless, if --headless starts
>     gui without cli args in Win, that is probably another issue that
>     should be raised for win vm)
>
>
> Oh, yes of course, I meant running
> pharo Pharo.image
>
>
>         I can access localhost:8888
>
>         but
>         ZnServer managedServers evaluates to "an IdentitySet()"
>
>         running
>
>         pharo --headless Pharo.image eval "ZnServer managedServers" shows
>         an IdentitySet(a ZnManagingMultiThreadedServer(stopped 8888))
>
>
>     Wow, it did not come to my mind to check that. That means it is
>     indeed the headless to gui transition that is problematic as
>     headless to headless is fine.
>
>         running eval without headless option:
>
>         pharo Pharo.image eval "ZnServer managedServers"
>         the set is again empty:
>         an IdentitySet()
>
>
>
>     Thanks, Herby
>
>
> It lools like ZnServer resets the ManagedServers variable, if the image
> starts without the headless option.

The problem is not image started without headless. It works fine if it
started without headless, just the sample.st must also be run without
headless. Only problem is sample.st run with headless and subsequently
image run without headless.

It unregisters it as a result of [ :each | each start ] during startup
phase in which the server(s) is(are) already in running state, as shown
in my last pharodebug.log posted here.

Maybe it launches startup phase twice, first doing it correctly, second
time failing it because start message is in fact
startWhenStoppedButRestartAndUnregisterWhenRunnning.

Herby

Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

Nicolai Hess-3-2


2017-07-26 13:16 GMT+02:00 Herby Vojčík <[hidden email]>:
Nicolai Hess wrote:


2017-07-26 13:08 GMT+02:00 Herby Vojčík <[hidden email]
<mailto:[hidden email]>>:

    Nicolai Hess wrote:



        2017-07-26 12:09 GMT+02:00 <[hidden email]
        <mailto:[hidden email]> <mailto:[hidden email]
        <mailto:[hidden email]>>>:



             On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe
        <[hidden email] <mailto:[hidden email]> <mailto:[hidden email]
        <mailto:[hidden email]>>> wrote:
        >
        >  > On 25 Jul 2017, at 19:46, Cyril Ferlicot D.
        ><[hidden email] <mailto:[hidden email]>
        <mailto:[hidden email]
        <mailto:[hidden email]>>> wrote:
        >  >
        >  > Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
        >  >> Hi,
        >  >>
        >  >> User Herby Vojčík seems to have an issue with the
        --headless option
        >on Windows 10
        >  >>
        >  >>
        >https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
        <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used>
        <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
        <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used>>
        >  >>
        >  >> I cannot reproduce his problem.
        >  >>
        >  >> Maybe there are Windows users out there who can have a look
        and help
        >him ?
        >
        >Anyone ?
        >


        I can reproduce the strange output:

        pharo --headless Pharo.image st sample.st <http://sample.st>
        <http://sample.st>

        with sample.st <http://sample.st> <http://sample.st> contains


        (ZnServer startOn: 8888) register.
        Smalltalk snapshot: true andQuit: true.

        Now starting the pharo image in gui mode

        pharo --headless Pharo.image


    This should probably be without --headless to be less strange
    (running in gui mode does not need --headless, if --headless starts
    gui without cli args in Win, that is probably another issue that
    should be raised for win vm)


Oh, yes of course, I meant running
pharo Pharo.image


        I can access localhost:8888

        but
        ZnServer managedServers evaluates to "an IdentitySet()"

        running

        pharo --headless Pharo.image eval "ZnServer managedServers" shows
        an IdentitySet(a ZnManagingMultiThreadedServer(stopped 8888))


    Wow, it did not come to my mind to check that. That means it is
    indeed the headless to gui transition that is problematic as
    headless to headless is fine.

        running eval without headless option:

        pharo Pharo.image eval "ZnServer managedServers"
        the set is again empty:
        an IdentitySet()



    Thanks, Herby


It lools like ZnServer resets the ManagedServers variable, if the image
starts without the headless option.

The problem is not image started without headless. It works fine if it started without headless, just the sample.st must also be run without headless. Only problem is sample.st run with headless and subsequently image run without headless.

It unregisters it as a result of [ :each | each start ] during startup phase in which the server(s) is(are) already in running state, as shown in my last pharodebug.log posted here.

Maybe it launches startup phase twice, first doing it correctly, second time failing it because start message is in fact startWhenStoppedButRestartAndUnregisterWhenRunnning.

Herby


Another interesting observation:

pharo Pharo.image
-> The window opens
now use the maximize window icon (on the pharo main window titlebar). Save and quit

pharo --headless Pharo.image eval "3+4"
-> the window opens for a short time

pharo Pharo.image
-> the window opens
now, even so the main window has the same same, it is not "maximized", don't change this, just do again a save and quit

pharo --headless Pharo.image eval "3+4"
-> now window opens, it just evaluates the command line




 

Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

Herby Vojčík
In reply to this post by Herby Vojčík
Herby Vojčík wrote:

> Nicolai Hess wrote:
>>
>>
>> 2017-07-26 13:08 GMT+02:00 Herby Vojčík <[hidden email]
>> <mailto:[hidden email]>>:
>>
>> Nicolai Hess wrote:
>>
>>
>>
>> 2017-07-26 12:09 GMT+02:00 <[hidden email]
>> <mailto:[hidden email]> <mailto:[hidden email]
>> <mailto:[hidden email]>>>:
>>
>>
>>
>> On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe
>> <[hidden email] <mailto:[hidden email]> <mailto:[hidden email]
>> <mailto:[hidden email]>>> wrote:
>> >
>> > > On 25 Jul 2017, at 19:46, Cyril Ferlicot D.
>> ><[hidden email] <mailto:[hidden email]>
>> <mailto:[hidden email]
>> <mailto:[hidden email]>>> wrote:
>> > >
>> > > Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
>> > >> Hi,
>> > >>
>> > >> User Herby Vojčík seems to have an issue with the
>> --headless option
>> >on Windows 10
>> > >>
>> > >>
>> >https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>>
>> <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used>
>>
>> <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>>
>> <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used>>
>>
>> > >>
>> > >> I cannot reproduce his problem.
>> > >>
>> > >> Maybe there are Windows users out there who can have a look
>> and help
>> >him ?
>> >
>> >Anyone ?
>> >
>>
>>
>> I can reproduce the strange output:
>>
>> pharo --headless Pharo.image st sample.st <http://sample.st>
>> <http://sample.st>
>>
>> with sample.st <http://sample.st> <http://sample.st> contains
>>
>> (ZnServer startOn: 8888) register.
>> Smalltalk snapshot: true andQuit: true.
>>
>> Now starting the pharo image in gui mode
>>
>> pharo --headless Pharo.image
>>
>>
>> This should probably be without --headless to be less strange
>> (running in gui mode does not need --headless, if --headless starts
>> gui without cli args in Win, that is probably another issue that
>> should be raised for win vm)
>>
>>
>> Oh, yes of course, I meant running
>> pharo Pharo.image
>>
>>
>> I can access localhost:8888
>>
>> but
>> ZnServer managedServers evaluates to "an IdentitySet()"
>>
>> running
>>
>> pharo --headless Pharo.image eval "ZnServer managedServers" shows
>> an IdentitySet(a ZnManagingMultiThreadedServer(stopped 8888))
>>
>>
>> Wow, it did not come to my mind to check that. That means it is
>> indeed the headless to gui transition that is problematic as
>> headless to headless is fine.
>>
>> running eval without headless option:
>>
>> pharo Pharo.image eval "ZnServer managedServers"
>> the set is again empty:
>> an IdentitySet()
>>
>>
>>
>> Thanks, Herby
>>
>>
>> It lools like ZnServer resets the ManagedServers variable, if the image
>> starts without the headless option.
>
> The problem is not image started without headless. It works fine if it
> started without headless, just the sample.st must also be run without
> headless. Only problem is sample.st run with headless and subsequently
> image run without headless.
>
> It unregisters it as a result of [ :each | each start ] during startup
> phase in which the server(s) is(are) already in running state, as shown
> in my last pharodebug.log posted here.
>
> Maybe it launches startup phase twice, first doing it correctly, second
> time failing it because start message is in fact
> startWhenStoppedButRestartAndUnregisterWhenRunnning.

It indeed looks like startup is happening twice (or Zinc installs two
startup hooks). I changed ZnSingleThreadedServer >> start to include

Transcript cr; show: '--- ZnServer >> start ---'; show: DateAndTime now;
show: ' ---'; cr; print: self; cr.

as the first statement, added 5 second pause between the --headless
script and gui image start and got this in the transcript window:


--- ZnServer >> start ---2017-07-26T14:40:57.478631+02:00 ---
a ZnManagingMultiThreadedServer(stopped 4998)

--- ZnServer >> start ---2017-07-26T14:40:57.705631+02:00 ---
a ZnManagingMultiThreadedServer(running 4998)

Now for the scarier part: when I ran the script in gui, and subsequently
loaded the image, the transcript shows:


Loaded -> Mocketry-Domain-Tests-cypress.1 ---
github://dionisiydk/Mocketry:v4.0.x [c21364a:v4.0.x] --- cache
...finished baseline
--- ZnServer >> start ---2017-07-26T14:51:12.643052+02:00 ---
a ZnManagingMultiThreadedServer(stopped 4998)

--- ZnServer >> start ---2017-07-26T14:51:18.359584+02:00 ---
a ZnManagingMultiThreadedServer(stopped 4998)

It seems only one start was sent in second image, because there is 5
second delay.

But it is at the same time scary, as in brings more questions than answers.

>
> Herby
>


Reply | Threaded
Open this post in threaded view
|

Re: Issue with the --headless option on Windows 10

Stephane Ducasse-3
Thanks you for checking that. All the startup logic got rewritten in
Pharo 6 to be able to have a more modular system
and there are probably things to align.

Stef

On Wed, Jul 26, 2017 at 3:01 PM, Herby Vojčík <[hidden email]> wrote:

> Herby Vojčík wrote:
>>
>> Nicolai Hess wrote:
>>>
>>>
>>>
>>> 2017-07-26 13:08 GMT+02:00 Herby Vojčík <[hidden email]
>>> <mailto:[hidden email]>>:
>>>
>>> Nicolai Hess wrote:
>>>
>>>
>>>
>>> 2017-07-26 12:09 GMT+02:00 <[hidden email]
>>> <mailto:[hidden email]> <mailto:[hidden email]
>>> <mailto:[hidden email]>>>:
>>>
>>>
>>>
>>> On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe
>>> <[hidden email] <mailto:[hidden email]> <mailto:[hidden email]
>>> <mailto:[hidden email]>>> wrote:
>>> >
>>> > > On 25 Jul 2017, at 19:46, Cyril Ferlicot D.
>>> ><[hidden email] <mailto:[hidden email]>
>>> <mailto:[hidden email]
>>> <mailto:[hidden email]>>> wrote:
>>> > >
>>> > > Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
>>> > >> Hi,
>>> > >>
>>> > >> User Herby Vojčík seems to have an issue with the
>>> --headless option
>>> >on Windows 10
>>> > >>
>>> > >>
>>>
>>> > >https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>>>
>>>
>>> <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used>
>>>
>>>
>>> <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
>>>
>>>
>>> <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used>>
>>>
>>> > >>
>>> > >> I cannot reproduce his problem.
>>> > >>
>>> > >> Maybe there are Windows users out there who can have a look
>>> and help
>>> >him ?
>>> >
>>> >Anyone ?
>>> >
>>>
>>>
>>> I can reproduce the strange output:
>>>
>>> pharo --headless Pharo.image st sample.st <http://sample.st>
>>> <http://sample.st>
>>>
>>> with sample.st <http://sample.st> <http://sample.st> contains
>>>
>>> (ZnServer startOn: 8888) register.
>>> Smalltalk snapshot: true andQuit: true.
>>>
>>> Now starting the pharo image in gui mode
>>>
>>> pharo --headless Pharo.image
>>>
>>>
>>> This should probably be without --headless to be less strange
>>> (running in gui mode does not need --headless, if --headless starts
>>> gui without cli args in Win, that is probably another issue that
>>> should be raised for win vm)
>>>
>>>
>>> Oh, yes of course, I meant running
>>> pharo Pharo.image
>>>
>>>
>>> I can access localhost:8888
>>>
>>> but
>>> ZnServer managedServers evaluates to "an IdentitySet()"
>>>
>>> running
>>>
>>> pharo --headless Pharo.image eval "ZnServer managedServers" shows
>>> an IdentitySet(a ZnManagingMultiThreadedServer(stopped 8888))
>>>
>>>
>>> Wow, it did not come to my mind to check that. That means it is
>>> indeed the headless to gui transition that is problematic as
>>> headless to headless is fine.
>>>
>>> running eval without headless option:
>>>
>>> pharo Pharo.image eval "ZnServer managedServers"
>>> the set is again empty:
>>> an IdentitySet()
>>>
>>>
>>>
>>> Thanks, Herby
>>>
>>>
>>> It lools like ZnServer resets the ManagedServers variable, if the image
>>> starts without the headless option.
>>
>>
>> The problem is not image started without headless. It works fine if it
>> started without headless, just the sample.st must also be run without
>> headless. Only problem is sample.st run with headless and subsequently
>> image run without headless.
>>
>> It unregisters it as a result of [ :each | each start ] during startup
>> phase in which the server(s) is(are) already in running state, as shown
>> in my last pharodebug.log posted here.
>>
>> Maybe it launches startup phase twice, first doing it correctly, second
>> time failing it because start message is in fact
>> startWhenStoppedButRestartAndUnregisterWhenRunnning.
>
>
> It indeed looks like startup is happening twice (or Zinc installs two
> startup hooks). I changed ZnSingleThreadedServer >> start to include
>
> Transcript cr; show: '--- ZnServer >> start ---'; show: DateAndTime now;
> show: ' ---'; cr; print: self; cr.
>
> as the first statement, added 5 second pause between the --headless script
> and gui image start and got this in the transcript window:
>
>
> --- ZnServer >> start ---2017-07-26T14:40:57.478631+02:00 ---
> a ZnManagingMultiThreadedServer(stopped 4998)
>
> --- ZnServer >> start ---2017-07-26T14:40:57.705631+02:00 ---
> a ZnManagingMultiThreadedServer(running 4998)
>
> Now for the scarier part: when I ran the script in gui, and subsequently
> loaded the image, the transcript shows:
>
>
> Loaded -> Mocketry-Domain-Tests-cypress.1 ---
> github://dionisiydk/Mocketry:v4.0.x [c21364a:v4.0.x] --- cache
> ...finished baseline
> --- ZnServer >> start ---2017-07-26T14:51:12.643052+02:00 ---
> a ZnManagingMultiThreadedServer(stopped 4998)
>
> --- ZnServer >> start ---2017-07-26T14:51:18.359584+02:00 ---
> a ZnManagingMultiThreadedServer(stopped 4998)
>
> It seems only one start was sent in second image, because there is 5 second
> delay.
>
> But it is at the same time scary, as in brings more questions than answers.
>
>>
>> Herby
>>
>
>