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

dependent jobs not triggered #675

Closed
fopina opened this issue Feb 9, 2020 · 3 comments · Fixed by #678
Closed

dependent jobs not triggered #675

fopina opened this issue Feb 9, 2020 · 3 comments · Fixed by #678
Labels

Comments

@fopina
Copy link
Contributor

fopina commented Feb 9, 2020

Describe the bug

Dependent jobs are not triggered

To Reproduce
Steps to reproduce the behavior:

  1. Create job1
{
  "name": "job1",
  "displayname": "",
  "timezone": "",
  "schedule": "@manually",
  "owner": "",
  "owner_email": "",
  "success_count": 1,
  "error_count": 0,
  "last_success": "2020-02-09T16:56:25.3426006Z",
  "last_error": null,
  "disabled": false,
  "tags": null,
  "metadata": null,
  "retries": 0,
  "dependent_jobs": [
    "job"
  ],
  "parent_job": "",
  "processors": {},
  "concurrency": "allow",
  "executor": "shell",
  "executor_config": {
    "command": "echo hello"
  },
  "status": "success",
  "next": "0001-01-01T00:00:00Z"
}
  1. Create job2, with parent_job set to job1
{
  "name": "job2",
  "displayname": "",
  "timezone": "",
  "schedule": "@manually",
  "owner": "",
  "owner_email": "",
  "success_count": 0,
  "error_count": 0,
  "last_success": null,
  "last_error": null,
  "disabled": false,
  "tags": null,
  "metadata": null,
  "retries": 0,
  "dependent_jobs": null,
  "parent_job": "job1",
  "processors": {},
  "concurrency": "allow",
  "executor": "shell",
  "executor_config": {
    "command": "echo bye"
  },
  "status": "",
  "next": "0001-01-01T00:00:00Z"
}
  1. Manually trigger job1

Expected behavior

job2 to be executed

** Specifications:**

  • OS: linux
  • Version 2.0.4

Additional context

dkron executed with

dkron agent --server --bootstrap-expect 1 --http-addr ':8082' --log-level debug

Output from the moment job1 was kicked

time="2020-02-09T17:01:11Z" level=debug msg="store: Retrieved job from datastore" job=job1 node=dkron_1
time="2020-02-09T17:01:11Z" level=debug msg="fsm: received command" command=0 node=dkron_1
time="2020-02-09T17:01:11Z" level=debug msg="store: Retrieved job from datastore" job=job1 node=dkron_1
time="2020-02-09T17:01:11Z" level=debug msg="store: Setting job" job=job1 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="agent: Filtered nodes to run: []" node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="agent: Filtered tags to run: map[region:global]" node=dkron_1
time="2020-02-09T17:01:12Z" level=info msg="agent: Sending query" job_name=job1 node=dkron_1 query="run:job"
time="2020-02-09T17:01:12Z" level=debug msg="agent: Sending query" job_name=job1 json="{\"execution\":{\"job_name\":\"job1\",\"started_at\":\"0001-01-01T00:00:00Z\",\"finished_at\":\"0001-01-01T00:00:00Z\",\"success\":false,\"group\":1581267671967359300,\"attempt\":1},\"rpc_addr\":\"172.18.0.3:6868\"}" node=dkron_1 query="run:job"
time="2020-02-09T17:01:12Z" level=info msg="agent: Received event" event="query: run:job" node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="agent: Running job" at=3 node=dkron_1 payload="{\"execution\":{\"job_name\":\"job1\",\"started_at\":\"0001-01-01T00:00:00Z\",\"finished_at\":\"0001-01-01T00:00:00Z\",\"success\":false,\"group\":1581267671967359300,\"attempt\":1},\"rpc_addr\":\"172.18.0.3:6868\"}" query="run:job"
time="2020-02-09T17:01:12Z" level=info msg="agent: Starting job" job=job1 node=dkron_1
time="2020-02-09T17:01:12Z" level=info msg="2020/02/09 17:01:12 [DEBUG] serf: messageQueryResponseType: dkron_1"
time="2020-02-09T17:01:12Z" level=debug msg="agent: Received ack" from=dkron_1 node=dkron_1 query="run:job"
time="2020-02-09T17:01:12Z" level=debug msg="grpc: Received GetJob" job=job1 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="store: Retrieved job from datastore" job=job1 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="agent: GetJob by RPC" job=job1 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="invoke: calling executor plugin" node=dkron_1 plugin=shell
time="2020-02-09T17:01:12Z" level=info msg="2020/02/09 17:01:12 [DEBUG] serf: messageQueryResponseType: dkron_1"
time="2020-02-09T17:01:12Z" level=debug msg="agent: Received response" from=dkron_1 node=dkron_1 query="run:job" response="{\"job_name\":\"job1\",\"started_at\":\"2020-02-09T17:01:12.0166161Z\",\"finished_at\":\"0001-01-01T00:00:00Z\",\"success\":false,\"node_name\":\"dkron_1\",\"group\":1581267671967359300,\"attempt\":1}"
time="2020-02-09T17:01:12Z" level=debug msg="2020/02/09 17:01:12 shell: going to run echo hello" node=dkron_1 subsystem_name=plugins.dkron-executor-shell
time="2020-02-09T17:01:12Z" level=debug msg="2020/02/09 17:01:12 shell: Command output hello" node=dkron_1 subsystem_name=plugins.dkron-executor-shell
time="2020-02-09T17:01:12Z" level=debug msg="invoke: Selected a server to send result" node=dkron_1 server="172.18.0.3:6868"
time="2020-02-09T17:01:12Z" level=debug msg="fsm: received command" command=2 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="store: Setting key" execution=executions/job1/1581267672016616100-dkron_1 finished="0001-01-01 00:00:00 +0000 UTC" job=job1 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="grpc: Received execution done" from=dkron_1 group=1581267671967359300 job=job1 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="store: Retrieved job from datastore" job=job1 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="fsm: received command" command=4 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="fsm: Setting execution" execution=1581267672016616100-dkron_1 node=dkron_1 output="hello\n"
time="2020-02-09T17:01:12Z" level=debug msg="store: Retrieved job from datastore" job=job1 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="store: Setting job" job=job1 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="store: Retrieved job from datastore" job=job1 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="store: Retrieved job from datastore" job=job node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="grpc: Running dependent job" job=job node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="store: Retrieved job from datastore" job=job2 node=dkron_1
time="2020-02-09T17:01:12Z" level=debug msg="grpc: Running dependent job" job=job2 node=dkron_1
@yvanoers
Copy link
Collaborator

@fopina The reproduction jobs by themselves will cause an error because job1 has a non-existent dependent job job. But if that is resolved, the dependent job still does not run.

This happens because the dependent job that is resolved does not have an agent object associated with it. I'm seeing this happen with scheduled and manual trigger.
Odd, I thought there was a test in place to check dependent jobs...

@vcastellm
Copy link
Member

Checking this, probably a regression introduced in latest changes. Fix coming.

@fopina
Copy link
Contributor Author

fopina commented Feb 13, 2020

🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants