-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Retry get Bucket on failure if possible #9
base: master
Are you sure you want to change the base?
Conversation
GoogleUtils.getStorageBucket can throw StorageException upon failure. This commit wrapps the call with a ExponentialBackOff logic.
@jnuxadrian, thanks for contribution. Could you please share some details and the stacktrace of the problem which fixes this PR? |
@dtretyakov Do you know of a way to enable only debug logs related to this plugin. Our TeamCity deployment is so massive, we in the past tried this and logs were rotated every 5s. |
[2018-11-07 02:26:50,175] WARN - blish.GoogleArtifactsPublisher - Failed to publish files: com.google.cloud.storage.StorageException: Error getting access token for service account: (enable debug to see stacktrace) |
We are using the GoogleRegularFileUploader.kt Given that there is two calls that could throw com.google.cloud.storage.StorageException
We rule out the first one cause we could not find in the build logs anything related to this retry message https://github.com/JetBrains/teamcity-google-storage/blob/master/google-storage-agent/src/main/kotlin/jetbrains/buildServer/artifacts/google/publish/GoogleRegularFileUploader.kt#L53 The second one instead is catch here https://github.com/JetBrains/teamcity-google-storage/blob/master/google-storage-agent/src/main/kotlin/jetbrains/buildServer/artifacts/google/publish/GoogleArtifactsPublisher.kt#L60 and this message match with what we found in the posted logs. |
@jnuxadrian, to see debug logs you need to configure logging preset on the build agent. For that modify the
Then in the AFAIK If you could enable debug logging on the build agents and could reproduce it, it will help us to investigate the problem. Another possible way is to enable signed URL option and check whether it prevents such problems. |
@dtretyakov Thanks for the log suggestion. Still I think is worthy to consider retry that call to google, it will make the plugin more reliable, and you already have that in place for creating the object. If you look at the gist of logs provided you will see that StorageException is not handled by GoogleRegularFileUploader. Don't you think that adding a retry to an external service call would make sense, or do you think the problem is happening in some other place ? |
GoogleUtils.getStorageBucket can throw StorageException
upon failure. This commit wrapps the call with a ExponentialBackOff
logic.