Project

General

Profile

Bug #21946

daqinterface starting multiple msgviewer per partition

Added by Ron Rechenmacher 7 months ago. Updated 7 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
02/21/2019
Due date:
% Done:

100%

Estimated time:
Experiment:
-
Co-Assignees:
Duration:

Description

multiple "just_do_it.sh" invocations produce multiple message viewers per partition.
For example, having just_do_it environments for partition 0 and partition 3 and doing 2 just_do_it.sh calls in each
produces:

/root
mu2edaq01 :^|  netstat -ulpn | grep viewer
udp        0      0 0.0.0.0:10005           0.0.0.0:*                           12436/msgviewer     
udp        0      0 0.0.0.0:10005           0.0.0.0:*                           26503/msgviewer     
udp        0      0 0.0.0.0:13005           0.0.0.0:*                           19292/msgviewer     
udp        0      0 0.0.0.0:13005           0.0.0.0:*                           21042/msgviewer     
--2019-02-21_16:48:54--

Associated revisions

Revision 86502da9 (diff)
Added by John Freeman 7 months ago

JCF: Issue #21946: Since stdin is now disabled from DAQInterface's perspective, determine the tty within the source_me script

Revision ea4ddd87 (diff)
Added by John Freeman 7 months ago

JCF: Issue #21946: forgot to add the source_me in the previous commit

Revision d9bf35ea (diff)
Added by John Freeman 7 months ago

JCF: since this fix hasn't yet been reviewed, I've moved it over to the feature/issue21946_multiple_msgviewers_launched branch

Revert "JCF: Issue #21946: Since stdin is now disabled from DAQInterface's perspective, determine the tty within the source_me script"

This reverts commit 86502da91729c1e18073539725dce7d5708f0809.

Revision 7672ad0b (diff)
Added by John Freeman 7 months ago

JCF: Issue #21946: Since stdin is now disabled from DAQInterface's perspective, determine the tty within the source_me script

Revision b5a8d707 (diff)
Added by John Freeman 7 months ago

JCF: Issue #21946: forgot to add the source_me in the previous commit

History

#1 Updated by John Freeman 7 months ago

  • % Done changed from 0 to 100
  • Assignee set to John Freeman
  • Status changed from New to Resolved

Fixed on feature/issue21946_multiple_msgviewers_launched (HEAD is ea4ddd87d517a4b8f1e063294b2e3d26b0c89649)

The problem is that the is_msgviewer_running() function which DAQInterface calls to determine if there's already a msgviewer window launched from its terminal broke when stdin for DAQInterface was disabled with a "<&-" as the solution to the hangs described in Issue #21804. The reason is_msgviewer_running() broke was that it had been calling tty to figure out what terminal it was in:

    tty = Popen("tty", shell=True,
                     stdout=subprocess.PIPE).stdout.readlines()[0].strip()

...but with stdin disabled, the return value wasn't something like "/dev/pts/2", but rather, "not a tty". So instead, what I've done is have the main DAQInterface source_me script determine the tty, and assign it to the DAQINTERFACE_TTY variable which is_msgviewer_running() can then check. Running just_do_it.sh more than once in a terminal, DAQInterface is now able to correctly recognize if a msgviewer has already been launched, so we don't end up with a new msgviewer window whenever we run just_do_it.sh.

#2 Updated by Ron Rechenmacher 7 months ago

I ran the demo, killed everything, merged feature/issue21946_multiple_msgviewers_launched into develop,
ran run_demo.sh, then reran just_d_it.sh and another msgviewer started.
git log:

commit 15f9b77360d345ece6a84fbfb44f5f18cff1f34d
Merge: d9bf35e ea4ddd8
Author: Ron <ron@fnal.gov>
Date:   Tue Feb 26 16:50:19 2019 -0600

    Merge branch 'feature/issue21946_multiple_msgviewers_launched' into develop

commit d9bf35ea56be91842d5e3850738bc01b6b963a42
Author: John Freeman <jcfree@mu2edaq01.fnal.gov>
Date:   Sat Feb 23 13:06:34 2019 -0600

    JCF: since this fix hasn't yet been reviewed, I've moved it over to the feature/issue21946_multiple_msgviewers_launched branch

    Revert "JCF: Issue #21946: Since stdin is now disabled from DAQInterface's perspective, determine the tty within the source_me script" 

    This reverts commit 86502da91729c1e18073539725dce7d5708f0809.

#3 Updated by John Freeman 7 months ago

After some investigating, I've determined that this is a rare case in which merging the feature branch into develop didn't actually bring in the desired changes- so the failed test above was actually testing the original, buggy algorithm. I've sent an email to Ron describing why the merge didn't do what it typically does and how to work around it; if anyone would like me to, I'll be happy to forward it to them.



Also available in: Atom PDF