eclipse-volttron / volttron-core

Other
5 stars 9 forks source link

Improved user experience for start-volttron command `volttron -vv -l volttron.log &>/dev/null &` #148

Open kefeimo opened 1 year ago

kefeimo commented 1 year ago

Describe the bug For volttron 10.0.3a2, to start the instance one needs to use volttron -vv -l volttron.log &>/dev/null & .

To Reproduce Steps to reproduce the behavior:

  1. source env/bin/activate
  2. volttron -vv -l volttron.log &>/dev/null &
  3. vctl status (working this time)
  4. volttron -vv -l volttron.log &>/dev/null &
  5. vctl status (NOT working this time) A walkaround is to kill the original process
  6. find the volttron process by running ps aux | grep volttron
  7. then stop the process by running kill -9 <volttron-procss-id>

Expected behavior Expect the platform is robust enough to handle running "volttron-start-like" command more than once but only point to the identical instance

Screenshots image

Additional info The volttron -vv -l volttron.log &>/dev/null & can be wrapped with a more user-interface-like command. The current one is very bash-like.

craig8 commented 1 year ago

Perhaps add a start-volttron command or volttron-start command that does the following

import os
os.spawnl(os.P_DETACH, 'some_long_running_command')

where the long running command is volttron -vv -l volttron.log ( I am not sure you need the dev/null, but may I am not 100% sure.

craig8 commented 1 year ago

@kefeimo is step 4 done before you shutdown the platform? If so that would error out and the process would continue to block which is what you are seeing.

It seems we should be able to detect this.

kefeimo commented 1 year ago

Yes. Step 4 is done before shutdown the platform. And yes, it was "able to detect this". But the point is merely detecting is not enough--as the following screenshot suggested a user will lose linkage to the volttron-instance

Recap:

  1. running volttron platform and view the volttron.log, then stop viewing

  2. run volttron -vv command again to trigger the error

  3. observed the detection "Attempted to bind Volttron to already bound address ipc://@/home/kefei/.volttron/run/vip.socket, stopping"

  4. vctl command not working any more

  5. the volttron process is still running (inspect by ps aux)

image

craig8 commented 1 year ago

Agreed just wanting clarification.

kefeimo commented 1 year ago

need the dev/null,

I don't think "need the dev/null," is needed but it is in the README

craig8 commented 1 year ago

The dev/null is for long running through ssh connections. the stderror gets corrupted and your platform won't be able to respond if you leave your ssh session and come back from a different ssh session.

At least that is what it is there for from volttron 4.