Skip to content

Conversation

@igordmn
Copy link
Collaborator

@igordmn igordmn commented Nov 20, 2025

For releases after 1.10.0-beta02

Release Notes

#5486
#5488

Attempt to fix:
```
Caused by: java.net.SocketTimeoutException: Socket timeout has expired [url=https://public.jetbrains.space/api/http/projects/.../packages/repositories/.../packages/name:org.jetbrains.skiko%2Fskiko-jvm-runtime-linux_x64/versions/version:1.4.0-rc01?%24fields=%2A, socket_timeout=unknown] ms
  at io.ktor.client.network.sockets.TimeoutExceptionsKt.SocketTimeoutException(TimeoutExceptions.kt:30)
  at io.ktor.client.plugins.HttpTimeoutKt.SocketTimeoutException(HttpTimeout.kt:272)
  at io.ktor.client.engine.okhttp.OkUtilsKt.mapOkHttpException(OkUtils.kt:82)
  at io.ktor.client.engine.okhttp.OkUtilsKt.access$mapOkHttpException(OkUtils.kt:1)
  at io.ktor.client.engine.okhttp.OkHttpCallback.onFailure(OkUtils.kt:42)
  at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:525)
  at COROUTINE_STACKTRACE_PRESERVATION_BOUNDARY.rethrow(Unknown Source)
  at space.jetbrains.api.runtime.stacktrace.RequestStacktraceKt.withPreservedStacktrace(RequestStacktrace.kt:13)
  at space.jetbrains.api.runtime.SpaceHttpClientKt.callSpaceApi(SpaceHttpClient.kt:128)
  at space.jetbrains.api.runtime.SpaceHttpClientKt.callSpaceApi$default(SpaceHttpClient.kt:80)
  at space.jetbrains.api.runtime.RestResource.callWithParameters(RestResource.kt:57)
  at space.jetbrains.api.runtime.RestResource.callWithParameters$default(RestResource.kt:50)
  at space.jetbrains.api.runtime.resources.projects.packages.repositories.packages.Versions.getPackageVersionDetails(Versions.kt:172)
  at space.jetbrains.api.runtime.resources.projects.packages.repositories.packages.Versions.getPackageVersionDetails$default(Versions.kt:162)
  at org.jetbrains.compose.internal.publishing.utils.SpaceApiClient$forEachPackageWithVersion$1$1.invokeSuspend(SpaceApiClient.kt:37)
  at org.jetbrains.compose.internal.publishing.utils.SpaceApiClient$forEachPackageWithVersion$1$1.invoke(SpaceApiClient.kt)
  at org.jetbrains.compose.internal.publishing.utils.SpaceApiClient$forEachPackageWithVersion$1$1.invoke(SpaceApiClient.kt)
  at org.jetbrains.compose.internal.publishing.utils.SpaceApiClient.forAllInAllBatches(SpaceApiClient.kt:76)
  at org.jetbrains.compose.internal.publishing.utils.SpaceApiClient.access$forAllInAllBatches(SpaceApiClient.kt:15)
  at org.jetbrains.compose.internal.publishing.utils.SpaceApiClient$forAllInAllBatches$1.invokeSuspend(SpaceApiClient.kt)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
  at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
  at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263)
  at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:94)
  at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:70)
  at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
  at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48)
  at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
  at org.jetbrains.compose.internal.publishing.utils.SpaceApiClient.withSpaceClient(SpaceApiClient.kt:52)
  at org.jetbrains.compose.internal.publishing.utils.SpaceApiClient.forEachPackageWithVersion(SpaceApiClient.kt:34)
  at org.jetbrains.compose.internal.publishing.FindModulesInSpaceTask.run(FindModulesInSpaceTask.kt:57)
  at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
  at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
  ... 117 more
```

happened 3 times in a row at
[19-11-2025](https://teamcity.jetbrains.com/buildConfiguration/JetBrainsPublicProjects_Compose_AllPublicRelease/5677823)

The default socket timeout is 10 seconds
([OkHttpEngine](https://github.com/ktorio/ktor/blob/c68f4ee0d5c37ed516498d705562528ee4c33be5/ktor-client/ktor-client-okhttp/jvm/src/io/ktor/client/engine/okhttp/OkHttpEngine.kt#L244
),
[OkHttpClient](https://github.com/square/okhttp/blob/5b23df713244f82f76cb05e8164d6320b6dc1379/okhttp/src/commonJvmAndroid/kotlin/okhttp3/OkHttpClient.kt#L1172))

Also replace deprecated calls by the suggested calls

## Testing
1. create a Space client key
2. set env. vars: COMPOSE_REPO_USERNAME, COMPOSE_DEV_REPO_PROJECT_ID,
COMPOSE_REPO_KEY, COMPOSE_DEV_REPO_REPO_ID
3. run
```
./gradlew -p=cli findComposeModules --info --stacktrace "-Pmaven.central.coordinates=org.jetbrains.androidx.lifecycle:*:2.10.0-alpha05,org.jetbrains.androidx.navigation3:*:1.0.0-alpha05,org.jetbrains.androidx.navigationevent:*:1.0.0-beta02,org.jetbrains.androidx.savedstate:*:1.4.0-rc01,org.jetbrains.androidx.window:*:1.5.0" "-Pmaven.central.deployName=CMP 1.10.0-beta02 (org.jetbrains.androidx)" --rerun-tasks
```

## Release Notes
N/A
Continuation of
#5486

Attempt to fix:
```
  Caused by: java.net.SocketTimeoutException: Read timed out
13:45:18    at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:867)
13:45:18    at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:829)
13:45:18    at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:366)
13:45:18    at org.jsoup.helper.HttpConnection.get(HttpConnection.java:353)
13:45:18    at org.jetbrains.compose.internal.publishing.DownloadFromSpaceMavenRepoTask.downloadArtifactsFromComposeDev(DownloadFromSpaceTask.kt:37)
13:45:18    at org.jetbrains.compose.internal.publishing.DownloadFromSpaceMavenRepoTask.run(DownloadFromSpaceTask.kt:28)
13:45:18    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
13:45:18    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
13:45:18    ... 117 more
```

happened at
[20-11-2025](https://teamcity.jetbrains.com/buildConfiguration/JetBrainsPublicProjects_Compose_Task5UploadToMavenCentral/5680809?showLog=5680809_16241_16045&logView=flowAware)

The default socket timeout is 30 seconds according JSoup docs

## Testing
1. create a Space client key
2. set env. vars: COMPOSE_REPO_USERNAME, COMPOSE_DEV_REPO_PROJECT_ID,
COMPOSE_REPO_KEY, COMPOSE_DEV_REPO_REPO_ID
3. run
```
./gradlew -p=cli downloadArtifactsFromComposeDev --info --stacktrace "-Pmaven.central.coordinates=org.jetbrains.androidx.lifecycle:*:2.10.0-alpha05,org.jetbrains.androidx.navigation3:*:1.0.0-alpha05,org.jetbrains.androidx.navigationevent:*:1.0.0-beta02,org.jetbrains.androidx.savedstate:*:1.4.0-rc01,org.jetbrains.androidx.window:*:1.5.0" "-Pmaven.central.deployName=CMP 1.10.0-beta02 (org.jetbrains.androidx)" --rerun-tasks
```

## Release Notes
N/A
@igordmn igordmn requested a review from siarb November 20, 2025 15:49
Copy link

@siarb siarb left a comment

Choose a reason for hiding this comment

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

And probably one more place is dependent on the timeout:

DownloadAction(project, this).apply {
    src(downloadableFiles.values)
    dest(destinationDir)
    connectTimeout(180_000)
    readTimeout(180_000)
    retries(3)
}.execute()

@igordmn
Copy link
Collaborator Author

igordmn commented Nov 20, 2025

And probably one more place is dependent on the timeout:

Thank you. I suggest to keep the current code and see if we still have issues in this line. We had issues with https://public.jetbrains.space/api, but downloadableFiles contains https://maven.pkg.jetbrains.space/public/p/compose/dev (the same that are used by the users)

@siarb siarb merged commit 5851953 into release/1.10 Nov 20, 2025
2 checks passed
@siarb siarb deleted the igor.demin/cherry-pick-timeout-fix branch November 20, 2025 16:48
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.

3 participants