oshied/directord

signals cannot be used in directord because they are incompatible with taskflow

mwhahaha opened this issue · 1 comments

Describe the bug
#351 has broken task-core's execution with task flow.

[2021-12-20 14:27:22,072] [DEBUG] repos-setup==1.0.0 directord execute - args: (), kwargs: {}, hosts: ['task-core-1', 'task-core-2', 'task-core-3', 'task-core-4'], data; {'id': 'setup', 'action': 'run', 'driver': 'directord', 'provides': ['repos.init'], 'jobs': [{'RUN': '--skip-cache --stdout-arg tripleo_repo_rpm curl -s https://trunk.rdoproject.org/centos8/component/tripleo/current/ | egrep -o \'"python3-tripleo-repos.*rpm"\' | tr -d "\\""'}, {'RUN': '--skip-cache dnf -y -q install https://trunk.rdoproject.org/centos8/component/tripleo/current/{{ tripleo_repo_rpm }}'}, {'RUN': '--skip-cache tripleo-repos --stream -b master current-tripleo ceph'}, {'RUN': '--skip-cache dnf -y -q clean all'}, {'RUN': '--skip-cache dnf -y -q makecache'}]}
[2021-12-20 14:27:22,072] [INFO] repos-setup==1.0.0 | Running
[2021-12-20 14:27:22,201] [DEBUG] Applying resolver 'RevertAll(strategy=REVERT_ALL)' to resolve failure 'Failure: ValueError: signal only works in main thread' of atom 'repos-setup==1.0.0'
[2021-12-20 14:27:22,278] [DEBUG] Modified/tweaked 103 nodes while applying resolver 'RevertAll(strategy=REVERT_ALL)'
[2021-12-20 14:27:22,279] [DEBUG] Discarding failure 'Failure: ValueError: signal only works in main thread' (in response to outcome 'executed') under completion units request during completion of atom 'repos-setup==1.0.0' (intention is to REVERT)
[2021-12-20 14:27:22,488] [DEBUG] Applying resolver 'RevertAll(strategy=REVERT_ALL)' to resolve failure 'Failure: ValueError: signal only works in main thread' of atom 'hostname-init==1.0.0'
[2021-12-20 14:27:22,491] [DEBUG] Modified/tweaked 103 nodes while applying resolver 'RevertAll(strategy=REVERT_ALL)'
[2021-12-20 14:27:22,491] [DEBUG] Discarding failure 'Failure: ValueError: signal only works in main thread' (in response to outcome 'executed') under completion units request during completion of atom 'hostname-init==1.0.0' (intention is to REVERT)
Traceback (most recent call last):
  File "/usr/bin/task-core", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.6/site-packages/task_core/cmd.py", line 154, in main
    e.run()
  File "/usr/lib/python3.6/site-packages/taskflow/engines/action_engine/engine.py", line 247, in run
    for _state in self.run_iter(timeout=timeout):
  File "/usr/lib/python3.6/site-packages/taskflow/engines/action_engine/engine.py", line 340, in run_iter
    failure.Failure.reraise_if_any(er_failures)
  File "/usr/lib/python3.6/site-packages/taskflow/types/failure.py", line 341, in reraise_if_any
    raise exc.WrappedFailure(failures)
taskflow.exceptions.WrappedFailure: WrappedFailure: [Failure: ValueError: signal only works in main thread, Failure: ValueError: signal only works in main thread]

To Reproduce
Steps to reproduce the behavior:

  1. Run basic task-core PoC

Expected behavior
No failures.

Correction: They can be used. Just not in the client library to interact with directord.