Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mon] Fix service collisions on ecal_mon_gui (5.13) #1550

Conversation

mlclark-resideo
Copy link
Contributor

@mlclark-resideo mlclark-resideo commented Apr 19, 2024

Very simple fix. Adds the service name to the ServiceTreeItem identifier so that different services running on the same host/process with the same methods don't get accidentally de-duped in ecal_mon_gui.

Description

This PR fixes the following bug:

Working example to demonstrate issue

This Python program creates two different eCAL services with the same PID, host, and method name.

import ecal.core.core as ecal_core
import ecal.core.service as ecal_service
import sys, time

def callback():
      pass

ecal_core.initialize(sys.argv, "BugDemo")
server1 = ecal_service.Server("MyService1")
server1.add_method_callback("GetConfig", "string", "string", callback)
server2 = ecal_service.Server("MyService2")
server2.add_method_callback("GetConfig", "string", "string", callback)

try:
    while True:
        time.sleep(1)
except KeyboardInterrupt:
    pass
finally:
    server1.destroy()
    server2.destroy()
    ecal_core.finalize()

Expected behavior

ecal_mon_gui should show both services on the service widget.

Actual behavior

ecal_mon_gui only shows one service (the most recent one):

image

The fix

This issue occurs because each of these service listings is a ServiceTreeItem, and the Service widget tracks and prunes ServiceTreeItems based on their generated identifier. The identifier currently only includes the PID, host, and method name. This fix adds the service name as well, so that services that only differ in their name still show up separately.

Now both services show up as expected:

image

Related issues

  • None (searched the open issues for GUI, none seemed related.)

Cherry-pick to

…erent services running on the same process with the same methods don't get accidentally de-duped.
@FlorianReimold FlorianReimold changed the title Fix service collisions on ecal_mon_gui [Mon] Fix service collisions on ecal_mon_gui (5.13) Apr 22, 2024
@FlorianReimold FlorianReimold merged commit 6d91219 into eclipse-ecal:support/v5.13 Apr 22, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants