zentol commented on pull request #16345: URL: https://github.com/apache/flink/pull/16345#issuecomment-876245791
> Conceptually, the RpcService should be self-contained in the sense that it has all the classes it needs to know. The ContextClassLoader business is surprisingly little about being able to _load_ a class. Virtually all of them are about preventing a thread stepping from akka to Flink land from leaking the akka classloader into Flink thread pools. > Concerning the unpacking of the flink-rpc-akka.jar, I am a bit unsure. It seems a bit hacky tbh. I agree it is not ideal, but it's imo the best option we got. > For running the tests, putting it on the classpath will bring in the Scala dependency, I guess. At that point you have already lost because you get 0 guarantees in regards to ordering. > For the Flink distribution it should not be a problem to directly place it in the plugins directory. [and for tests we do that, and for users running examples in the IDE we do that] Which will result in 3 separate ways how this stuff is loaded, with test-specific stuff likely seeping into production code. > One idea could be to make the flink-rpc-akka.jar self-contained and when one tries to load the AkkaRpcService, then one will create a new class loader that only contains this jar on the class path. Not sure whether this is easily doable, though. We can certainly extract the jar from the CP, but once it's on the CP we already lost. -- 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]
