Issue with the --headless option on Windows 10
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-wh... I cannot reproduce his problem. Maybe there are Windows users out there who can have a look and help him ? Thx, Sven
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-wh...
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
On 25 Jul 2017, at 19:46, Cyril Ferlicot D. <cyril.ferlicot@gmail.com> 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-wh...
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
2017-07-26 11:53 GMT+02:00 Sven Van Caekenberghe <sven@stfx.eu>:
On 25 Jul 2017, at 19:46, Cyril Ferlicot D. <cyril.ferlicot@gmail.com> 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
On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 25 Jul 2017, at 19:46, Cyril Ferlicot D. <cyril.ferlicot@gmail.com> 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-wh...
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
2017-07-26 12:09 GMT+02:00 <herby@mailbox.sk>:
On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe < sven@stfx.eu> wrote:
On 25 Jul 2017, at 19:46, Cyril Ferlicot D. <cyril.ferlicot@gmail.com> 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
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()
Nicolai Hess wrote:
2017-07-26 12:09 GMT+02:00 <herby@mailbox.sk <mailto:herby@mailbox.sk>>:
On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe <sven@stfx.eu <mailto:sven@stfx.eu>> wrote: > > > On 25 Jul 2017, at 19:46, Cyril Ferlicot D. ><cyril.ferlicot@gmail.com <mailto:cyril.ferlicot@gmail.com>> 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-wh... <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-wh...> > >> > >> 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
2017-07-26 13:08 GMT+02:00 Herby VojÄÃk <herby@mailbox.sk>:
Nicolai Hess wrote:
2017-07-26 12:09 GMT+02:00 <herby@mailbox.sk <mailto:herby@mailbox.sk>>:
On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe <sven@stfx.eu <mailto:sven@stfx.eu>> wrote: > > > On 25 Jul 2017, at 19:46, Cyril Ferlicot D. ><cyril.ferlicot@gmail.com <mailto:cyril.ferlicot@gmail.com>> 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-managedSer vers-disappear-when-headless-mode-used <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedSer vers-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.
Nicolai Hess wrote:
2017-07-26 13:08 GMT+02:00 Herby VojÄÃk <herby@mailbox.sk <mailto:herby@mailbox.sk>>:
Nicolai Hess wrote:
2017-07-26 12:09 GMT+02:00 <herby@mailbox.sk <mailto:herby@mailbox.sk> <mailto:herby@mailbox.sk <mailto:herby@mailbox.sk>>>:
On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe <sven@stfx.eu <mailto:sven@stfx.eu> <mailto:sven@stfx.eu <mailto:sven@stfx.eu>>> wrote: > > > On 25 Jul 2017, at 19:46, Cyril Ferlicot D. ><cyril.ferlicot@gmail.com <mailto:cyril.ferlicot@gmail.com> <mailto:cyril.ferlicot@gmail.com <mailto:cyril.ferlicot@gmail.com>>> 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-wh... <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-wh...> <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-wh... <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
2017-07-26 13:16 GMT+02:00 Herby VojÄÃk <herby@mailbox.sk>:
Nicolai Hess wrote:
2017-07-26 13:08 GMT+02:00 Herby VojÄÃk <herby@mailbox.sk <mailto:herby@mailbox.sk>>:
Nicolai Hess wrote:
2017-07-26 12:09 GMT+02:00 <herby@mailbox.sk <mailto:herby@mailbox.sk> <mailto:herby@mailbox.sk <mailto:herby@mailbox.sk>>>:
On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe <sven@stfx.eu <mailto:sven@stfx.eu> <mailto:sven@stfx.eu <mailto:sven@stfx.eu>>> wrote: > > > On 25 Jul 2017, at 19:46, Cyril Ferlicot D. ><cyril.ferlicot@gmail.com <mailto:cyril.ferlicot@gmail.com> <mailto:cyril.ferlicot@gmail.com <mailto:cyril.ferlicot@gmail.com>>> 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-managedSer vers-disappear-when-headless-mode-used <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedSer vers-disappear-when-headless-mode-used> <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedSer vers-disappear-when-headless-mode-used <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedSer vers-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
Herby VojÄÃk wrote:
Nicolai Hess wrote:
2017-07-26 13:08 GMT+02:00 Herby VojÄÃk <herby@mailbox.sk <mailto:herby@mailbox.sk>>:
Nicolai Hess wrote:
2017-07-26 12:09 GMT+02:00 <herby@mailbox.sk <mailto:herby@mailbox.sk> <mailto:herby@mailbox.sk <mailto:herby@mailbox.sk>>>:
On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe <sven@stfx.eu <mailto:sven@stfx.eu> <mailto:sven@stfx.eu <mailto:sven@stfx.eu>>> wrote:
On 25 Jul 2017, at 19:46, Cyril Ferlicot D. <cyril.ferlicot@gmail.com <mailto:cyril.ferlicot@gmail.com>
<mailto:cyril.ferlicot@gmail.com <mailto:cyril.ferlicot@gmail.com>>> 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-wh...
<https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-wh...>
<https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-wh...
<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
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 <herby@mailbox.sk> wrote:
Herby VojÄÃk wrote:
Nicolai Hess wrote:
2017-07-26 13:08 GMT+02:00 Herby VojÄÃk <herby@mailbox.sk <mailto:herby@mailbox.sk>>:
Nicolai Hess wrote:
2017-07-26 12:09 GMT+02:00 <herby@mailbox.sk <mailto:herby@mailbox.sk> <mailto:herby@mailbox.sk <mailto:herby@mailbox.sk>>>:
On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe <sven@stfx.eu <mailto:sven@stfx.eu> <mailto:sven@stfx.eu <mailto:sven@stfx.eu>>> wrote:
On 25 Jul 2017, at 19:46, Cyril Ferlicot D. <cyril.ferlicot@gmail.com <mailto:cyril.ferlicot@gmail.com>
<mailto:cyril.ferlicot@gmail.com <mailto:cyril.ferlicot@gmail.com>>> 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-wh...
<https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-wh...>
<https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-wh...
<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
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-wh...
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
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-wh...
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
participants (6)
-
Cyril Ferlicot D. -
Herby VojÄÃk -
herby@mailbox.sk -
Nicolai Hess -
Stephane Ducasse -
Sven Van Caekenberghe