Skip to content

Trim extra Runnable() check from run executor#1917

Merged
j16r merged 1 commit intodevelopfrom
chore/trim_extra_finished_check_from_run_executor
Nov 11, 2019
Merged

Trim extra Runnable() check from run executor#1917
j16r merged 1 commit intodevelopfrom
chore/trim_extra_finished_check_from_run_executor

Conversation

@j16r
Copy link
Copy Markdown
Contributor

@j16r j16r commented Nov 11, 2019

No description provided.

@j16r j16r requested review from coventry and dimroc November 11, 2019 22:22
taskRun.ApplyOutput(result)
run.ApplyOutput(result)

if !result.Status().Runnable() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure this is ok. I believe that the calls above can change the status again such that Runnable() is false.

ie: the following lines could change Status

			result := je.executeTask(&run, taskRun)
			taskRun.ApplyOutput(result)
			run.ApplyOutput(result)

My memory of the code could very well be outdated, so I would double check.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is only a logger.Debugw statement so not the end of the world.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The following lines could change the status, but if you follow the linear expanded flow, the code used to look like this:

result := je.executeTask(&run, taskRun)
taskRun.ApplyOutput(result)
run.ApplyOutput(result)
if finished {
  logger.Debug
}
if finished {
  continue
}

now it is:

result := je.executeTask(&run, taskRun)
taskRun.ApplyOutput(result)
run.ApplyOutput(result)
if finished {
  logger.Debug
  continue
}

Copy link
Copy Markdown
Contributor

@dimroc dimroc left a comment

Choose a reason for hiding this comment

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

for loop ensures debug statement.

@j16r j16r merged commit c7d180a into develop Nov 11, 2019
@j16r j16r deleted the chore/trim_extra_finished_check_from_run_executor branch November 11, 2019 22:45
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.

2 participants