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

[SPARK-43977][CONNECT] Fix unexpected check result of dev/connect-jvm-client-mima-check #41473

Closed
wants to merge 2 commits into from

Conversation

LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Jun 6, 2023

What changes were proposed in this pull request?

There is an unexpected check scenario of dev/connect-jvm-client-mima-check as follows:

  1. run build/sbt "protobuf/clean"
  2. run dev/connect-jvm-client-mima-check

Then is a strange check result

Failed to find the jar: spark-protobuf-assembly(.*).jar or spark-protobuf(.*)3.5.0-SNAPSHOT.jar inside folder: /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/protobuf/target. This file can be generated by similar to the following command: build/sbt package|assembly
finish connect-client-jvm module mima check ...
connect-client-jvm module mima check passed.

There are both error messages and checks successful as above.

So this pr do the following changes to fix this unexpected check scenario:

  1. Add a line break after write error message in CheckConnectJvmClientCompatibility to avoid RESULT_SIZE being considered as 0:

after this change, run the above commands, the check result result is expected:

Do connect-client-jvm module mima check ...
Failed to find the jar: spark-protobuf-assembly(.*).jar or spark-protobuf(.*)3.5.0-SNAPSHOT.jar inside folder: /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/protobuf/target. This file can be generated by similar to the following command: build/sbt package|assembly
finish connect-client-jvm module mima check ...
ERROR: Failed to find the jar: spark-protobuf-assembly(.*).jar or spark-protobuf(.*)3.5.0-SNAPSHOT.jar inside folder: /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/protobuf/target. This file can be generated by similar to the following command: build/sbt package|assembly
connect-client-jvm module mima check failed.
  1. Change protobuf/package to protobuf/assembly to ensure spark-protobuf uber jar always present

after this change, run the above commands, the check result result is successful:

Do connect-client-jvm module mima check ...
finish connect-client-jvm module mima check ...
connect-client-jvm module mima check passed.

Why are the changes needed?

Fix wrong check result of dev/connect-jvm-client-mima-check

Does this PR introduce any user-facing change?

No

How was this patch tested?

  • Pass GitHub Actions
  • Do manual checks as pr description

@LuciferYang LuciferYang marked this pull request as draft June 6, 2023 03:49
@LuciferYang LuciferYang changed the title [SPARK-43977][TESTS] Change protobuf/package to protobuf/assembly and add a line break after error message [SPARK-43977][CONNECT] Change protobuf/package to protobuf/assembly and add a line break after error message Jun 6, 2023
@LuciferYang LuciferYang changed the title [SPARK-43977][CONNECT] Change protobuf/package to protobuf/assembly and add a line break after error message [SPARK-43977][CONNECT] Change protobuf/package to protobuf/assembly and add a line break after write error message Jun 6, 2023
@LuciferYang LuciferYang marked this pull request as ready for review June 6, 2023 04:01
@LuciferYang LuciferYang changed the title [SPARK-43977][CONNECT] Change protobuf/package to protobuf/assembly and add a line break after write error message [SPARK-43977][CONNECT] Fix unexpected check result of dev/connect-jvm-client-mima-check Jun 6, 2023
@@ -95,7 +95,7 @@ object CheckConnectJvmClientCompatibility {
} catch {
case e: Throwable =>
println(e.getMessage)
resultWriter.write(s"ERROR: ${e.getMessage}")
resultWriter.write(s"ERROR: ${e.getMessage}\n")
Copy link
Member

@dongjoon-hyun dongjoon-hyun Jun 6, 2023

Choose a reason for hiding this comment

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

The old code seems to exist since Apache Spark 3.4.0 but SPARK-43977 is filed for 3.5.0 only. Do we need to backport this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dongjoon-hyun Thanks for your review. Good question. Due to Spark 3.4.x will not add new modules for mima check with connect module, this issue should not be triggered, so I think just fixing it in Spark 3.5.0 is enough now

Copy link
Member

Choose a reason for hiding this comment

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

Got it~

@LuciferYang
Copy link
Contributor Author

Merged to master. Thanks @dongjoon-hyun

czxm pushed a commit to czxm/spark that referenced this pull request Jun 12, 2023
…m-client-mima-check`

### What changes were proposed in this pull request?
There is an unexpected check scenario of `dev/connect-jvm-client-mima-check` as follows:

1. run `build/sbt "protobuf/clean"`
2. run `dev/connect-jvm-client-mima-check`

Then  is a strange check result

```
Failed to find the jar: spark-protobuf-assembly(.*).jar or spark-protobuf(.*)3.5.0-SNAPSHOT.jar inside folder: /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/protobuf/target. This file can be generated by similar to the following command: build/sbt package|assembly
finish connect-client-jvm module mima check ...
connect-client-jvm module mima check passed.
```

There are both error messages and checks successful as above.

So this pr do the following changes to fix this unexpected check scenario:

1. Add a line break after write error message in `CheckConnectJvmClientCompatibility` to avoid `RESULT_SIZE` being considered as `0`:

after this change, run the above commands, the check result result is expected:

```
Do connect-client-jvm module mima check ...
Failed to find the jar: spark-protobuf-assembly(.*).jar or spark-protobuf(.*)3.5.0-SNAPSHOT.jar inside folder: /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/protobuf/target. This file can be generated by similar to the following command: build/sbt package|assembly
finish connect-client-jvm module mima check ...
ERROR: Failed to find the jar: spark-protobuf-assembly(.*).jar or spark-protobuf(.*)3.5.0-SNAPSHOT.jar inside folder: /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/protobuf/target. This file can be generated by similar to the following command: build/sbt package|assembly
connect-client-jvm module mima check failed.
```

2. Change `protobuf/package` to `protobuf/assembly` to ensure spark-protobuf uber jar always present

after this change, run the above commands, the check result result is successful:

```
Do connect-client-jvm module mima check ...
finish connect-client-jvm module mima check ...
connect-client-jvm module mima check passed.
```

### Why are the changes needed?
Fix wrong check result of `dev/connect-jvm-client-mima-check`

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
- Pass GitHub Actions
- Do manual checks as pr description

Closes apache#41473 from LuciferYang/SPARK-43590-FOLLOWUP.

Authored-by: yangjie01 <yangjie01@baidu.com>
Signed-off-by: yangjie01 <yangjie01@baidu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants