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

Fixes #25736 - Pass id of request which triggered a task into the task #383

Closed
wants to merge 9 commits into from

Conversation

adamruzicka
Copy link
Contributor

No description provided.

@iNecas
Copy link
Member

iNecas commented Jan 24, 2019

Tested and works well, except covering exceptions logging, which could be solved by this adamruzicka#2

@iNecas
Copy link
Member

iNecas commented Jan 24, 2019

Dynflow 1.2.1 has been released, let's bump the version dependency

@@ -10,11 +10,15 @@ def self.included(base)
# Hook to be called when a repetition needs to be triggered. This either happens when the plan goes into planned state
# or when it fails.
def trigger_repeat(execution_plan)
request_id = ::Logging.mdc['request']
::Logging.mdc['request'] = nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussion with @ponrjek, we think the best way to support the recurring jobs would be to assign it a new (but non-empty) request id, so that we can group the related tasks from every iteration together (otherwise, we can do it just with the first iteration)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I also log that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I canl handle the logging part in separate PR

@iNecas
Copy link
Member

iNecas commented Jan 24, 2019

Two last comments before merging this.

Copy link
Member

@iNecas iNecas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending fixing tests. Otherwise works well and can be merged once CI is green

# Perform the planning (trigger repeat)
task.execution_plan.delay_record.plan
repetition = recurring_logic.tasks.find { |t| t.id != task.id }
repetition.input[:current_request_id].must_be :nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be updated as well

Copy link
Member

@iNecas iNecas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything's good now

@iNecas
Copy link
Member

iNecas commented Jan 28, 2019

Merged as 12b53f2, thanks @adamruzicka

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

Successfully merging this pull request may close these issues.

3 participants