iLCSoft / CEDViewer

Marlin processor for the CED event display
GNU General Public License v3.0
2 stars 9 forks source link

ced2go tries to connect to CED_HOST, with n flag disabled #21

Closed dudarboh closed 2 years ago

dudarboh commented 2 years ago

Intro

One can use ced2go in two modes:

  1. Fully remotely with:
    ced2go -d ./detector_file.xml data.sclio
  2. Using local machine as a host, specifying it explicitly with n argument:
    export CED_HOST=flc19
    ced2go -n 1 -d ./detector_file.xml data.sclio

Issue

However if the environment variable CED_HOST is not empty, e.g. because it was specified in the .bashrc for convenience The fully remote version, w/o -n flag, still tries to connect to the $CED_HOST and fails.

Reproducible

export CED_HOST=xyz
ced2go -d ./detector_file.xml data.sclio

with output:

[ MESSAGE "MyCEDViewer"] Use user defined host xyz, port 6684
 *** Break *** segmentation violation

Expected

It would be nice that if n flag is NOT specified it should ignore what is written in the env `$CED_HOST.

tmadlener commented 2 years ago

One possibility in this case could be to simply unset the CED_HOST variable from within ced2go, when appropriate. This should be as simple as os.environ.pop('CED_HOST', None) (where the default None is just there to make sure that nothing breaks if it is not set). This would have to be done before the actual CEDViewer process is started. This also should leave the environment outside the python process of ced2go untouched.

CED_HOST is taken from the environment here. So fixing this on a deeper level might be a bit more involved.

dudarboh commented 2 years ago

@tmadlener @gaede