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

Improved WorkflowRun.finish timing #357

Merged
merged 5 commits into from
May 24, 2023

Conversation

jglick
Copy link
Member

@jglick jglick commented May 23, 2023

I found that BulkChange from CpsFlowExecution.notifyListeners caused WorkflowRun.completed to be false in build.xml at the moment RunListener.onFinalized is called. Was noted in 18d78f3 in #27.

@jglick jglick requested a review from a team as a code owner May 23, 2023 21:47
@jglick jglick added the bug label May 23, 2023
@@ -663,7 +664,6 @@ private void finish(@NonNull Result r, @CheckForNull Throwable t) {
onEndBuilding();
} finally { // Ensure this is ALWAYS removed from FlowExecutionList
FlowExecutionList.get().unregister(new Owner(this));
listener = null;
Copy link
Member Author

Choose a reason for hiding this comment

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

Also need to move up listener clearing. Otherwise listener wold be non-null (thus still logUpdated) at the moment finish saved, thus failing WorkflowRunTest.basics.

@@ -118,7 +118,7 @@ public class WorkflowRunRestartTest {

@Issue({"JENKINS-45585", "JENKINS-50784"}) // Verifies execution lazy-load
@Test public void lazyLoadExecution() {
story.thenWithHardShutdown(r -> {
story.then(r -> {
Copy link
Member Author

Choose a reason for hiding this comment

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

@jglick

This comment was marked as resolved.

}

try {
StashManager.maybeClearAll(this, /* or move up before closing getListener()? */new LogTaskListener(LOGGER, Level.FINE));
Copy link
Member Author

Choose a reason for hiding this comment

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

@jglick jglick changed the title Improved WorkflowRun.saveWithoutFailing Improved WorkflowRun.finish timing May 24, 2023
@jglick jglick marked this pull request as ready for review May 24, 2023 19:52
@jglick jglick requested a review from dwnusbaum May 24, 2023 20:27
@jglick jglick merged commit 054d9ce into jenkinsci:master May 24, 2023
@jglick jglick deleted the WorkflowRun.saveWithoutFailing branch May 24, 2023 20:44
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 this pull request may close these issues.

3 participants