Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][io] Fix Kotlin version issue for functions built in Kotlin #19924

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions distribution/server/src/assemble/LICENSE.bin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -407,16 +407,9 @@ The Apache Software License, Version 2.0
* Google Error Prone Annotations - com.google.errorprone-error_prone_annotations-2.5.1.jar
* Apache Thrift - org.apache.thrift-libthrift-0.14.2.jar
* OkHttp3
- com.squareup.okhttp3-logging-interceptor-4.9.3.jar
- com.squareup.okhttp3-okhttp-4.9.3.jar
* Okio - com.squareup.okio-okio-2.8.0.jar
- com.squareup.okhttp3-logging-interceptor-4.10.0.jar
- com.squareup.okhttp3-okhttp-4.10.0.jar
* Javassist -- org.javassist-javassist-3.25.0-GA.jar
* Kotlin Standard Lib
- org.jetbrains.kotlin-kotlin-stdlib-1.8.20.jar
- org.jetbrains.kotlin-kotlin-stdlib-common-1.8.20.jar
- org.jetbrains.kotlin-kotlin-stdlib-jdk7-1.8.20.jar
- org.jetbrains.kotlin-kotlin-stdlib-jdk8-1.8.20.jar
- org.jetbrains-annotations-13.0.jar
* gRPC
- io.grpc-grpc-all-1.45.1.jar
- io.grpc-grpc-auth-1.45.1.jar
Expand Down
53 changes: 32 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,10 @@ flexible messaging model and an intuitive client API.</description>
<jakarta.xml.bind.version>2.3.3</jakarta.xml.bind.version>
<jakarta.validation.version>2.0.2</jakarta.validation.version>
<jna.version>5.12.1</jna.version>
<okhttp3.version>4.10.0</okhttp3.version>
<kubernetesclient.version>18.0.0</kubernetesclient.version>
<okhttp3.version>4.9.3</okhttp3.version>
<!-- use okio version that matches the okhttp3 version -->
<okio.version>2.8.0</okio.version>
<!-- override kotlin-stdlib used by okio in order to address CVE-2020-29582 -->
<kotlin-stdlib.version>1.8.20</kotlin-stdlib.version>
<okio.version>3.3.0</okio.version>
<nsq-client.version>1.0</nsq-client.version>
<cron-utils.version>9.1.6</cron-utils.version>
<spring.version>5.3.27</spring.version>
Expand Down Expand Up @@ -1326,40 +1324,53 @@ flexible messaging model and an intuitive client API.</description>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp3.version}</version>
<exclusions>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.squareup.okio</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-urlconnection</artifactId>
<version>${okhttp3.version}</version>
<exclusions>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.squareup.okio</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>${okhttp3.version}</version>
<exclusions>
Copy link
Member

Choose a reason for hiding this comment

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

@abhilashmandaliya if we exclude kotlin dep here, is it possible we are missing bundling several jars so that the function shade jar won't work?

<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.squareup.okio</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>${okio.version}</version>
</dependency>

<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin-stdlib.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-common</artifactId>
<version>${kotlin-stdlib.version}</version>
</dependency>

<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin-stdlib.version}</version>
</dependency>

<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@
import org.apache.pulsar.functions.proto.Function.FunctionDetails;
import org.apache.pulsar.functions.proto.Function.SinkSpec;
import org.apache.pulsar.functions.proto.InstanceCommunication;
import org.jetbrains.annotations.NotNull;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import javax.annotation.Nonnull;

public class JavaInstanceRunnableTest {

static class IntegerSerDe implements SerDe<Integer> {
Expand Down Expand Up @@ -164,7 +165,7 @@ public void testFunctionResultNull() throws Exception {
verify(record, times(1)).ack();
}

@NotNull
@Nonnull
private JavaInstanceRunnable getJavaInstanceRunnable(boolean autoAck,
org.apache.pulsar.functions.proto.Function.ProcessingGuarantees processingGuarantees) throws Exception {
FunctionDetails functionDetails = FunctionDetails.newBuilder()
Expand Down