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

artifacts is not deployed intermittently #93

Closed
tonytvo opened this issue Aug 18, 2016 · 17 comments
Closed

artifacts is not deployed intermittently #93

tonytvo opened this issue Aug 18, 2016 · 17 comments

Comments

@tonytvo
Copy link

tonytvo commented Aug 18, 2016

Here's the log files I can gather using the gradle debug mode:

[INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :Locales:artifactoryPublish (Thread[Task worker Thread 3,5,main]) started.
[LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] :Locales:artifactoryPublish
[DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':Locales:artifactoryPublish' is up-to-date
[INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Executing task ':Locales:artifactoryPublish' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.
[DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':Locales:artifactoryPublish'.
[DEBUG] [org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask] Task ':Locales:artifactoryPublish' activated
[org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':Locales:artifactoryPublish'

I took a look at the code and apparently, for some reasons this block of code:

            List<BuildInfoBaseTask> remainingTasks = new ArrayList<BuildInfoBaseTask>();
            for (BuildInfoBaseTask task : getAllBuildInfoTasks()) {
                if (!isTaskExecuted(task)) {
                    remainingTasks.add(task);
                }
            }

            if (remainingTasks.size() <= 1) {
            ...
            }

return remainingTasks list that has more than 1 element and this is why it doesn't upload the artifact to artifactory. This doesn't happen all the times, it happens intermittently.

The environment details are:
gradle 3.0
build-info-extractor-gradle: 4.4.0

Any comments/suggestion would be greatly appreciated.

Cheers,
Tony

@eyalbe4
Copy link
Contributor

eyalbe4 commented Aug 18, 2016

@tonytvo, can you please share with a sample project that reproduces this behaviour, so that we can debug it?

@tonytvo
Copy link
Author

tonytvo commented Aug 18, 2016

it's a little bit more troublesome to create mock project that would simulate the exact behaviors, I will take a stab at it and see what I can do.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Sep 5, 2016

@tonytvo,
Thanks for reporting this issue. It looks like you found a race condition when the plugin tries to determine the task that should handle the deployment.
We opened GAP-266 to track this fix. This is the fix commit. If you're able to build the code, you can already help us verify the new code resolves the issue.

@tonytvo
Copy link
Author

tonytvo commented Sep 5, 2016

I will try it to night, I'm sorry, hasn't had chance to look into this yet

On Sep 5, 2016 9:47 AM, "Eyal Ben Moshe" notifications@github.com wrote:

@tonytvo https://github.com/tonytvo,
Thanks for reporting this issue. It looks like you found a race condition
when the plugin tries to determine the task that should handle the
deployment.
We opened GAP-266 https://www.jfrog.com/jira/browse/GAP-266 to track
this fix. This
d4f02fd
is the fix commit. If you're able to build the code, you can already help
us verify the new code resolves the issue.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#93 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AI--wvW5cRX_egoVaprsGbBK0-8V28xzks5qnDmhgaJpZM4JnOVd
.


If you believe you have received this electronic transmission in error,
please notify the original sender of this email and destroy all copies of
this communication.

@tonytvo
Copy link
Author

tonytvo commented Sep 20, 2016

This is what I got after I upgrade to build-info-extractor-4.4.4

* What went wrong:
Execution failed for task ':Custom:CSI:ResMD:DicomFS:artifactoryPublish'.
> File '/home/tvo/Development/CSI/build/resmd-gradle/gradleBuild/Locales/publications/pureweb-ja-JP_language/pom-default.xml' does not exist, and need to be published from publication pureweb-ja-JP_language

@eyalbe4
Copy link
Contributor

eyalbe4 commented Sep 20, 2016

@tonytvo,
The fix is not part of 4.4.4. I'll create a snapshot version, so that you can try out the fix.

@tonytvo
Copy link
Author

tonytvo commented Sep 20, 2016

thanks @eyalbe4 , I checked the commit logs and apparently issue #92 hasn't been addressed yet. Would I still see that pom-default.xml does not exist and need to be published?

@tonytvo
Copy link
Author

tonytvo commented Sep 20, 2016

@eyalbe4 , I think I narrow down the problem a little bit.
For some reasons, upgrade build-info-extractor to 4.4.4 from 4.4.0, makes gradle skip all "generatePomFileFor*Publication", so I have to manually go through each build.gradle file in 53 subprojects and add the following line

afterEvaluate {
    artifactoryPublish.dependsOn 'generatePomFileForXXXPublication'
}

Here's the snapshot of one of my gradle file of one of the sub modules:

apply plugin: 'maven-publish'

task xxxZip() {
}

publishing {
    publications {
        'xxx-sample' (MavenPublication) {
        }
    }
}

artifactoryPublish {
    publications ( publishing.publications.'xxx-sample')
}

afterEvaluate {
    artifactoryPublish.dependsOn 'generatePomFileForXxx-samplePublication'
}

Let me know if you need anything else from me

@tonytvo
Copy link
Author

tonytvo commented Sep 23, 2016

@eyalbe4 , I saw that you have tagged 4.4.5 version, but I can't find 4.4.5 on jcenter, would it be uploaded there, or is there different place that it would be uploaded?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Sep 23, 2016

@tonytvo, we will publish 4.4.5 to jcenter soon. We'll let you know when it is there.

@tonytvo
Copy link
Author

tonytvo commented Sep 25, 2016

@eyalbe4 , I'm sorry, after upgrade to 4.4.5, it still skip uploading artifacts intermittently, on top of that I also have to put in afterEvaluate { artifactoryPublish.dependsOn 'generatePomFileForxxxPublication' } block to get it to work.

@tonytvo
Copy link
Author

tonytvo commented Sep 25, 2016

I'm sorry, my bad, I forgot to change the version of the build info extract. I ran the scripts to do upload to artifactory 30 times and it all seems to work. Although I have to add afterEvaluate block to get it to work with build-info-extractor 4.4.5, but that's mentioned in another issue ticket. I will close this ticket for now.

Thank you very much @eyalbe4

@tonytvo tonytvo closed this as completed Sep 25, 2016
@tonytvo
Copy link
Author

tonytvo commented Sep 27, 2016

I just saw your commits to master again for race condition on deploying? do I need to update the version of build-info-extractor again?

@tonytvo tonytvo reopened this Sep 27, 2016
@eyalbe4
Copy link
Contributor

eyalbe4 commented Sep 27, 2016

I'm sorry about that @tonytvo.
Today's commit has a wrong commit message.
The issue you reported is fixed by version 4.4.5.
Today's commit is aimed at fixing a compatibility issue with Gradle 3.0. You can close this issue.

@tonytvo
Copy link
Author

tonytvo commented Sep 27, 2016

ok, no problem I will close this issue again then.
As a side note, is the fix related to issue #92 ?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Sep 27, 2016

The code committed today is for #98 and #99
We'll update about #92 soon.

@tonytvo
Copy link
Author

tonytvo commented Sep 27, 2016

thanks @eyalbe4 , I will close this ticket then

@tonytvo tonytvo closed this as completed Sep 27, 2016
RobiNino pushed a commit to RobiNino/build-info that referenced this issue Oct 7, 2020
Added sha256sum values to deploy-files bash script. Also updated the script to handle coreutils not being installed.
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

No branches or pull requests

2 participants