Skip to content

Commit

Permalink
Release 2.3.5 (#3771)
Browse files Browse the repository at this point in the history
* KTOR-6221: Fix reduced concurrent reqs in Apache5 (#3738)

When using the Apache5 engine, total concurrent requests to a single
route were limited to 5 requests. This is due to the code which tried to
increase the concurrency to the ktor-standard 1000 concurrent having a
typo and setting the total max connections twice and missing the max
connections
completely.

(cherry picked from commit fa5cba1)

* Avoid crashing when TLS TCP socket is closed (#3690)

* Avoid crashing when TLS TCP socket is closed

When using a plain TCP socket with TLS, two worker jobs are spawned:

- cio-tls-input-loop
- cio-tls-output-loop

These worker jobs live in their own scope, and exceptions they throw can't
easily be caught by the caller: the only option is to install a
`CoroutineExceptionHandler` for the whole TLS socket, which is quite hacky
and may hide bugs.

When the TCP socket is closed, this is only caught when trying to write
on the output channel, which throws a `ClosedSendChannelException`.
We now catch that exception and cleanly stop the background job.

Fixes https://youtrack.jetbrains.com/issue/KTOR-5178/TLSSocket-cannot-catch-the-exception-thrown-by-appDataOutputLoop
Fixes https://youtrack.jetbrains.com/issue/KTOR-4360/Android-Impossible-to-catch-the-ClosedSendChannelException-when-TLS-connection-socket-is-closed

* fixup! Avoid crashing when TLS TCP socket is closed

(cherry picked from commit 1905329)

* KTOR-6229 Fix hostname verification in CIO (#3746)

(cherry picked from commit 53fa31a)

* KTOR-5540 Fix darwin ws pong message (#3747)

* KTOR-5540 Fix darwin ws pong message

* Update ktor-client/ktor-client-darwin/darwin/test/DarwinEngineTest.kt

Co-authored-by: Vitor Hugo Schwaab <vitor@schwaab.dev>

---------

Co-authored-by: Rustam <rxsinukov@gmail.com>
Co-authored-by: Vitor Hugo Schwaab <vitor@schwaab.dev>

(cherry picked from commit 375b0d3)

* Update netty monorepo to v4.1.97.Final (#3627)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
(cherry picked from commit a0ae1eb)

* KTOR-6292 Make client use Dispatchers.IO by default (#3748)

* KTOR-6292 Make client use Dispatchers.IO by default

(cherry picked from commit a22852c)

* Update kotlin to 1.9.10 (#3761)

* Fix mingwX64 compilation

* Update kotlin to 1.9.10

* Fix CallLogging tests

* Fix js compilation

(cherry picked from commit 8a9f4a5)

* fixup! Update kotlin to 1.9.10 (#3761)

* KTOR-6286 Update xmlutil to 0.86.2 (#3770)

(cherry picked from commit 87181e4)

---------

Co-authored-by: Sebastian Mayr <smayr@atlassian.com>
Co-authored-by: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Mariia Skripchenko <61115099+marychatte@users.noreply.github.com>
  • Loading branch information
5 people authored Oct 4, 2023
1 parent 32b9395 commit 51e7e5f
Show file tree
Hide file tree
Showing 155 changed files with 1,360 additions and 1,166 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ apply(from = "gradle/compatibility.gradle")

plugins {
id("org.jetbrains.dokka") version "1.7.20" apply false
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.12.1"
id("kotlinx-atomicfu") version "0.19.0" apply false
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2"
id("kotlinx-atomicfu") version "0.22.0" apply false
id("com.osacky.doctor") version "0.8.1"
}

Expand Down
8 changes: 4 additions & 4 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*/

plugins {
id("org.gradle.kotlin.kotlin-dsl") version "3.2.4"
kotlin("plugin.serialization") version "1.7.21"
id("org.gradle.kotlin.kotlin-dsl") version "4.1.0"
kotlin("plugin.serialization") version "1.9.0"
}

val buildSnapshotTrain = properties["build_snapshot_train"]?.toString()?.toBoolean() == true
Expand All @@ -24,8 +24,8 @@ sourceSets.main {
val ktor_version = "2.3.2"

dependencies {
implementation(kotlin("gradle-plugin", "1.8.22"))
implementation(kotlin("serialization", "1.8.22"))
implementation(kotlin("gradle-plugin", "1.9.10"))
implementation(kotlin("serialization", "1.9.10"))

val ktlint_version = libs.versions.ktlint.version.get()
implementation("org.jmailen.gradle:kotlinter-gradle:$ktlint_version")
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/CommonConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ fun Project.configureCommon() {

kotlin {
sourceSets {
val commonMain by getting {
commonMain {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
}
}

val commonTest by getting {
commonTest {
dependencies {
implementation(kotlin("test"))
}
Expand Down
22 changes: 13 additions & 9 deletions buildSrc/src/main/kotlin/JsConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,24 @@ private fun Project.configureJsTasks() {
kotlin {
js(IR) {
nodejs {
testTask {
useMocha {
timeout = "10000"
testTask(
Action {
useMocha {
timeout = "10000"
}
}
}
)
}

browser {
testTask {
useKarma {
useChromeHeadless()
useConfigDirectory(File(project.rootProject.projectDir, "karma"))
testTask(
Action {
useKarma {
useChromeHeadless()
useConfigDirectory(File(project.rootProject.projectDir, "karma"))
}
}
}
)
}

binaries.library()
Expand Down
10 changes: 10 additions & 0 deletions buildSrc/src/main/kotlin/KotlinExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ fun KotlinMultiplatformExtension.createCInterop(
}
}

fun NamedDomainObjectContainer<KotlinSourceSet>.commonMain(block: KotlinSourceSet.() -> Unit) {
val sourceSet = getByName("commonMain")
block(sourceSet)
}

fun NamedDomainObjectContainer<KotlinSourceSet>.commonTest(block: KotlinSourceSet.() -> Unit) {
val sourceSet = getByName("commonTest")
block(sourceSet)
}

fun NamedDomainObjectContainer<KotlinSourceSet>.jvmAndNixMain(block: KotlinSourceSet.() -> Unit) {
val sourceSet = findByName("jvmAndNixMain") ?: getByName("jvmMain")
block(sourceSet)
Expand Down
11 changes: 11 additions & 0 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright 2014-2023 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

object Versions {
val kotlin = "1.9.10"
val coroutines = "1.7.2"
val slf4j = "1.7.36"
val junit = "4.13.2"
val logback = "1.2.11"
}
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/test/server/ServerUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fun List<PartData>.makeString(): String = buildString {
}
}

@Suppress("DEPRECATION")
private fun filenameContentTypeAndContentString(provider: () -> Input, headers: Headers): String {
val dispositionHeader: String = headers.getAll(HttpHeaders.ContentDisposition)!!.joinToString(";")
val disposition: ContentDisposition = ContentDisposition.parse(dispositionHeader)
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/test/server/TestServer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ internal fun startServer(): Closeable {
tests()
}.start()

scope.use(Closeable { server.stop(0L, 0L, TimeUnit.MILLISECONDS) })
scope.use { server.stop(0L, 0L, TimeUnit.MILLISECONDS) }

val tlsServer = setupTLSServer()
tlsServer.start()
scope.use(Closeable { tlsServer.stop(0L, 0L, TimeUnit.MILLISECONDS) })
scope.use { tlsServer.stop(0L, 0L, TimeUnit.MILLISECONDS) }

Thread.sleep(1000)
} catch (cause: Throwable) {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ktor.ide.jvmAndCommonOnly=true
kotlin.code.style=official

# config
version=2.3.4
version=2.3.5

# gradle
org.gradle.daemon=true
Expand All @@ -34,7 +34,7 @@ kotlin.native.binary.memoryModel=experimental

kotlin_version=1.8.22
coroutines_version=1.7.1
atomicfu_version=0.20.2
atomicfu_version=0.22.2
slf4j_version=1.7.36
junit_version=4.13.2
logback_version=1.2.11
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
kotlin-version = "1.8.22"
kotlinx-html-version = "0.9.1"
coroutines-version = "1.7.2"
atomicfu-version = "0.20.2"
atomicfu-version = "0.22.0"
serialization-version = "1.5.1"
validator-version = "0.8.0"
ktlint-version = "3.15.0"

netty-version = "4.1.92.Final"
netty-version = "4.1.97.Final"
netty-tcnative-version = "2.0.61.Final"

jetty-version = "9.4.51.v20230217"
Expand Down Expand Up @@ -58,7 +58,7 @@ jakarta-servlet-version = "5.0.0"
node-fetch-version = "2.6.7"
abort-controller-version = "3.0.0"
ws-version = "8.5.0"
xmlutil-version = "0.86.1"
xmlutil-version = "0.86.2"
yamlkt-version = "0.12.0"

swagger-codegen-version = "3.0.41"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 51e7e5f

Please sign in to comment.