tisonkun commented on PR #23003:
URL: https://github.com/apache/flink/pull/23003#issuecomment-1638274576
> a rotten foundation
Unfortunately, it's complicated on this packing issue to explain in several
words.
> Double-check whether the final jar actually contains the relocated netty.
I checked the bundled 'flink-sql-connector-pulsar' JAR and it contains -
```
unzip -t
flink-connector-pulsar/flink-sql-connector-pulsar/target/flink-sql-connector-pulsar-4.0-SNAPSHOT.jar
| grep ChannelMatchers
testing:
org/apache/pulsar/shade/io/netty/channel/group/ChannelMatchers$InstanceMatcher.class
OK
testing:
org/apache/pulsar/shade/io/netty/channel/group/ChannelMatchers$ClassMatcher.class
OK
testing:
org/apache/pulsar/shade/io/netty/channel/group/ChannelMatchers$1.class OK
testing:
org/apache/pulsar/shade/io/netty/channel/group/ChannelMatchers.class OK
testing:
org/apache/pulsar/shade/io/netty/channel/group/ChannelMatchers$CompositeMatcher.class
OK
testing:
org/apache/pulsar/shade/io/netty/channel/group/ChannelMatchers$InvertMatcher.class
OK
```
... also the pulsar-client-all 3.0
```
unzip -t
~/.m2/repository/org/apache/pulsar/pulsar-client-all/3.0.0/pulsar-client-all-3.0.0.jar
| grep ChannelMatchers
testing:
org/apache/pulsar/shade/io/netty/channel/group/ChannelMatchers$InstanceMatcher.class
OK
testing:
org/apache/pulsar/shade/io/netty/channel/group/ChannelMatchers$ClassMatcher.class
OK
testing:
org/apache/pulsar/shade/io/netty/channel/group/ChannelMatchers$1.class OK
testing:
org/apache/pulsar/shade/io/netty/channel/group/ChannelMatchers.class OK
testing:
org/apache/pulsar/shade/io/netty/channel/group/ChannelMatchers$CompositeMatcher.class
OK
testing:
org/apache/pulsar/shade/io/netty/channel/group/ChannelMatchers$InvertMatcher.class
OK
```
> You then tried to change the relocation pattern (why?)
I don't know, actually. If a class loading issue happened, it can be a name
resolution issue. Then I found it strange we shade "flink-connector-pulsar"
classes as "org.apache.pulsar.shade" which can be conflicted with the Pulsar
bundled one. Since the connector use its own classes, it should use its own
shade patten in the beginning.
Now the result is that without relocation, tests always failed. With the
change, it can pass - https://github.com/apache/flink-connector-pulsar/pull/54
Given the proposed shade pattern changed isn't a hack but what it should be
initially done (IMO), it doesn't cause regressions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]