Hi, we're using ktor 2.1.3 (had a bunch of issues trying to upgrade to 2.2.x) and have a ktor servic...
b

Brent Beardsley

almost 3 years ago
Hi, we're using ktor 2.1.3 (had a bunch of issues trying to upgrade to 2.2.x) and have a ktor service that hits another external rest api using ktor client. After the service has been running for about 24 hours, all the ktor client requests start failing and continue to fail with: io.ktor.client.network.sockets.ConnectTimeoutException: Connect timeout has expired [url=<<REDACTED>>, connect_timeout=unknown ms] at io.ktor.client.plugins.HttpTimeoutKt.ConnectTimeoutException(HttpTimeout.kt:209) at io.ktor.client.plugins.HttpTimeoutKt.ConnectTimeoutException$default(HttpTimeout.kt:206) at io.ktor.client.engine.cio.Endpoint.getTimeoutException(Endpoint.kt:217) at io.ktor.client.engine.cio.Endpoint.connect(Endpoint.kt:206) at io.ktor.client.engine.cio.Endpoint.access$connect(Endpoint.kt:23) at io.ktor.client.engine.cio.Endpoint$connect$1.invokeSuspend(Endpoint.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) If we restart the service all the errors go away. Has anyone seen this? Thanks, Brent
Something changed in Gradle 7.6 from 7.5.x. I have this in the `podspec` file generated by the cocoa...
r

ribesg

almost 3 years ago
Something changed in Gradle 7.6 from 7.5.x. I have this in the
podspec
file generated by the cocoapods plugin:
spec.pod_target_xcconfig = {
        'KOTLIN_PROJECT_PATH' => ':',
        'PRODUCT_MODULE_NAME' => 'whatever',
    }
                
    spec.script_phases = [
        {
            :name => 'Build events',
            :execution_position => :before_compile,
            :shell_path => '/bin/sh',
            :script => <<-SCRIPT
                if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
                  echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
                  exit 0
                fi
                set -ev
                REPO_ROOT="$PODS_TARGET_SRCROOT"
                "$REPO_ROOT/gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
                    -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
                    -Pkotlin.native.cocoapods.archs="$ARCHS" \
                    -Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
            SCRIPT
        }
    ]
Notice how
KOTLIN_PROJECT_PATH
has value
:
and the Gradle command ran has parameter
$KOTLIN_PROJECT_PATH:syncFramework
which would be
::syncFramework
. This worked with Gradle 7.5.1 but fails with Gradle 7.6:
Cannot locate tasks that match '::syncFramework'. The path should not include an empty segment (try ':syncFramework' instead).
I suppose they added a check. Can't find it in the changelog. I guess I'll do some kind of
sed
task running after the
podGenIOS
task in order to fix the
podspec
(probably set
KOTLIN_PROJECT_PATH
to empty), but am I right thinking the generated
podspec
file is kinda broken?