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

List of workers can give wrong result #135

Closed
jirihnidek opened this issue Jun 22, 2023 · 2 comments · Fixed by #252
Closed

List of workers can give wrong result #135

jirihnidek opened this issue Jun 22, 2023 · 2 comments · Fixed by #252
Assignees

Comments

@jirihnidek
Copy link
Contributor

jirihnidek commented Jun 22, 2023

Describe the bug
List of workers can be incomplete or it can contain workers that are not active anymore

To Reproduce

  1. Start yggdrasil on Terminal 1: go run ./cmd/yggd --server tcp://localhost:1883 --log-level trace --client-id $(hostname)
  2. Start echo worker on Terminal 2: go run ./worker/echo -log-level trace
  3. Try to get list of workers on Terminal 3 using: go run ./cmd/yggctl workers list or busctl --user call com.redhat.Yggdrasil1 /com/redhat/Yggdrasil1 com.redhat.Yggdrasil1 ListWorkers

Current result
List of workers is empty. The worker gets into the list of workers only after receiving the first message from MQTT.

Expected behavior
List of running workers.

Something like this in the case of yggctl:

echo - DispatchedAt:
echo - Version: 1

Something like this in the case of busctl (or any other D-Bus app):

a{sa{ss}} 1 "echo" 2 "Version" "1" "DispatchedAt" ""

Additional Information

  • OS: Fedora 38
  • Version: main branch

When worker has been stopped, then you can still see worker in the list of active workers despite MQTT message for the worker has been received and yggdrasil wasn't able to dispatch data from the MQTT message.

@jirihnidek
Copy link
Contributor Author

Started discussion that is related to this issue: #169

@subpop
Copy link
Collaborator

subpop commented Nov 15, 2023

Each worker is expected to own a name on the bus under the namespace com.redhat.Yggdrasil1.Worker1 (i.e. com.redhat.Yggdrasil1.Worker1.echo). When asked for a list of workers, yggd should enumerate all names on the bus, filter for names that begin with the namespace value above, and return the results.

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 a pull request may close this issue.

2 participants