Skip to content

Conversation

@arganzheng
Copy link
Contributor

@arganzheng arganzheng commented Jun 13, 2019

What is the purpose of the change

fix issue https://issues.apache.org/jira/browse/FLINK-12725. No need to copy the flink-hadoop-compatibility jar explicitly to ${FLINK-HOME}/lib location.

Brief change log

change the classLoader of org.apache.flink.api.java.typeutils.WritableTypeInfo from TypeExtractor.class.getClassLoader() to Thread.currentThread().getContextClassLoader().

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): ( no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no/)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

@flinkbot
Copy link
Collaborator

flinkbot commented Jun 13, 2019

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit d72363e (Tue Aug 06 15:42:44 UTC 2019)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.

Details
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@arganzheng
Copy link
Contributor Author

@aljoscha Here

@dawidwys
Copy link
Contributor

Hi @arganzheng,
Thank you for your contribution. Could you please update the subject of this PR according to the contribution guidelines?

@aljoscha
Copy link
Contributor

Thanks! I merged this already. For next time, please provide a good title for the PR according to the contribution guidelines, as Dawid mentioned.

@aljoscha aljoscha closed this Jun 13, 2019
@arganzheng
Copy link
Contributor Author

Sorry for the title, I did not read the guidelines carefully.

@ben-wangz
Copy link

i cherry-pick this fix to release-1.8.0 and run it with mongo input format (org.mongodb, mongo-hadoop-core, 1.3.0)。 found exception of java.lang.LinkageError:

Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy.setFallbackInstantiatorStrategy(Lorg/objenesis/strategy/InstantiatorStrategy;)V" the class loader (instance of org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoaders$ChildFirstClassLoader) of the current class, org/apache/flink/api/java/typeutils/runtime/WritableSerializer, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, com/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy, have different Class objects for the type org/objenesis/strategy/InstantiatorStrategy used in the signature
        at org.apache.flink.api.java.typeutils.runtime.WritableSerializer.checkKryoInitialized(WritableSerializer.java:131)
        at org.apache.flink.api.java.typeutils.runtime.WritableSerializer.copy(WritableSerializer.java:68)
        at org.apache.flink.api.java.typeutils.runtime.WritableSerializer.copy(WritableSerializer.java:42)
        at org.apache.flink.api.java.typeutils.runtime.TupleSerializer.copy(TupleSerializer.java:111)
        at org.apache.flink.api.java.typeutils.runtime.TupleSerializer.copy(TupleSerializer.java:37)
        at org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.pushToOperator(OperatorChain.java:577)
        at org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.collect(OperatorChain.java:554)
        at org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.collect(OperatorChain.java:534)
        at org.apache.flink.streaming.api.operators.AbstractStreamOperator$CountingOutput.collect(AbstractStreamOperator.java:718)
        at org.apache.flink.streaming.api.operators.AbstractStreamOperator$CountingOutput.collect(AbstractStreamOperator.java:696)
        at org.apache.flink.streaming.api.operators.StreamSourceContexts$NonTimestampContext.collect(StreamSourceContexts.java:104)
        at org.apache.flink.streaming.api.functions.source.InputFormatSourceFunction.run(InputFormatSourceFunction.java:93)
        at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:93)
        at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:57)
        at org.apache.flink.streaming.runtime.tasks.SourceStreamTask.run(SourceStreamTask.java:97)
        at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:300)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:711)
        at java.lang.Thread.run(Thread.java:745)

@HenryCaiHaiying
Copy link

@ben-wangz I have the same issue on flink 1.9.1: how did you work around it?

Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy.setFallbackInstantiatorStrategy(Lorg/objenesis/strategy/InstantiatorStrategy;)V" the class loader (instance of org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoaders$ChildFirstClassLoader) of the current class, org/apache/flink/api/java/typeutils/runtime/WritableSerializer, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, com/esotericsoftware/kryo/Kryo$DefaultInstantiatorStrategy, have different Class objects for the type org/objenesis/strategy/InstantiatorStrategy used in the signature

@gwshawsh
Copy link

gwshawsh commented Apr 3, 2020

@HenryCaiHaiying flink-conf.yml ->classloader.resolve-order: parent-first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants