Skip to content

Conversation

guizmaii
Copy link
Contributor

@guizmaii guizmaii commented Jul 2, 2025

The publishing of zio-aws takes a lot of time because it publishes a lot of libs and because of that fails to publish to the new Maven Central repo as the publishing process timeouts.
See https://github.com/zio/zio-aws/actions/runs/16018360517/job/45195274956

Previously, with the sbt-sonatype plugin, we were able to configure the sonatypeTimeoutMillis setting
(https://github.com/zio/zio-aws/pull/1517/files#diff-928a6eabff1094f1b64a2d1b6bc7574c5a483476ec3fee98c16d1fe46aae9d0dL101)

@@ -66,7 +69,6 @@ class SonaClient(reqTransform: Request => Request) extends AutoCloseable {
FormPart("bundle", bundleZipPath.toFile())
)
)
.withRequestTimeout(600.second)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already configured in http

Copy link
Member

Choose a reason for hiding this comment

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

Current implementation uses 2 minute timeout for status check type of request, and 10 minutes for the bundle upload. It seems like you are collapsing the two into one setting but with 2 minute timeout here. I feel like it might be better to pick a large enough value for upload timeout (60 min?) rather than make this configurable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Current implementation uses 2 minute timeout for status check type of request, and 10 minutes for the bundle upload. It seems like you are collapsing the two into one setting but with 2 minute timeout here

My bad. It's fixed in my latest changes

I feel like it might be better to pick a large enough value for upload timeout (60 min?) rather than make this configurable.

I'm just scared that if it's not enough for someone, we'll need to make a new change and publish a new version of sbt, which can delay people's work. I think it'd be simpler to make it configurable so it can fit any need, like it was in sbt-sonatype

@guizmaii guizmaii marked this pull request as ready for review July 2, 2025 09:59
@guizmaii guizmaii changed the title Allow users to configure the timeout when publishing to the Maven Central repo [1.x] Allow users to configure the timeout when publishing to the Maven Central repo Jul 2, 2025
@guizmaii guizmaii requested a review from eed3si9n July 4, 2025 12:33
@guizmaii guizmaii force-pushed the sonaRelease_timeout branch from 6428e83 to 09e55cc Compare July 4, 2025 12:39
@guizmaii guizmaii force-pushed the sonaRelease_timeout branch from 09e55cc to 8c0010a Compare July 4, 2025 12:40
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

overall LGTM, but for future reference, please split out non-semantic-change refactorings out to a separate pull request in the future for easier code review.

@eed3si9n eed3si9n merged commit 0558c56 into sbt:1.11.x Jul 5, 2025
9 checks passed
@guizmaii guizmaii deleted the sonaRelease_timeout branch July 5, 2025 08:12
@guizmaii
Copy link
Contributor Author

guizmaii commented Jul 5, 2025

Thanks @eed3si9n. Would it be possible for you to release a new version with this change, please?

@eed3si9n
Copy link
Member

eed3si9n commented Jul 5, 2025

https://eed3si9n.com/sbt-1.11.3 is released

@guizmaii
Copy link
Contributor Author

guizmaii commented Jul 7, 2025

@eed3si9n I made this change in zio-aws: https://github.com/zio/zio-aws/pull/1554/files#diff-928a6eabff1094f1b64a2d1b6bc7574c5a483476ec3fee98c16d1fe46aae9d0dR104
Yet, publishing timed out after ~20minutes:

java.util.concurrent.TimeoutException: Futures timed out after [1215 seconds]
	at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:269)
	at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:273)
	at scala.concurrent.Await$.$anonfun$result$1(package.scala:223)
	at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:57)
	at scala.concurrent.Await$.result(package.scala:146)
	at sbt.internal.sona.SonaClient.awaitWithMessage(Sona.scala:174)
	at sbt.internal.sona.SonaClient.uploadBundle(Sona.scala:86)
	at sbt.internal.sona.Sona.uploadBundle(Sona.scala:35)
	at sbt.internal.librarymanagement.Publishing$.sonatypeReleaseAction(Publishing.scala:57)
	at sbt.internal.librarymanagement.Publishing$.$anonfun$sonaRelease$1(Publishing.scala:24)

(See https://github.com/zio/zio-aws/actions/runs/16110990896/job/45458269962)

Would you have any why this didn't respect the 2.hours values I've set? 🤔

@eed3si9n
Copy link
Member

eed3si9n commented Jul 7, 2025

I should've caught this during the code review but it seems like this PR added the setting at the project level, instead of the global level. So to override the value you have to rewire it at the root project level, instead of ThisBuild.

deploymentStatusF(deploymentId)
}
Await.result(res, 600.seconds)
Await.result(res, 10.minutes)
Copy link
Member

Choose a reason for hiding this comment

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

Also there's still 10.minutes hardcoded here.

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