You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/12/08 08:50:01 UTC

[jira] [Commented] (BEAM-682) Invoker Class should be created in Thread Context Classloader

    [ https://issues.apache.org/jira/browse/BEAM-682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16283218#comment-16283218 ] 

ASF GitHub Bot commented on BEAM-682:
-------------------------------------

rmannibucau opened a new pull request #4235: [BEAM-682] try to define generated classes in the correct classloader instead of the beam classloader by default
URL: https://github.com/apache/beam/pull/4235
 
 
   Overall idea is that a generated class is bound to a "model" class and therefore belongs to the same classloader (in term of lifecycle).
   
   Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/projects/BEAM/issues/) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Invoker Class should be created in Thread Context Classloader
> -------------------------------------------------------------
>
>                 Key: BEAM-682
>                 URL: https://issues.apache.org/jira/browse/BEAM-682
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>    Affects Versions: 0.3.0-incubating
>            Reporter: Sumit Chawla
>            Assignee: Sumit Chawla
>
> As of now the InvokerClass is being loaded in wrong classloader. It should be loaded into Thread.currentThread.getContextClassLoader()
> https://github.com/apache/incubator-beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvokers.java#L167
> {code}
>  Class<? extends DoFnInvoker<?, ?>> res =
>         (Class<? extends DoFnInvoker<?, ?>>)
>             unloaded
>                 .load(DoFnInvokers.class.getClassLoader(), ClassLoadingStrategy.Default.INJECTION)
>                 .getLoaded();
> {code}
> Fix 
> {code}
>  Class<? extends DoFnInvoker<?, ?>> res =
>         (Class<? extends DoFnInvoker<?, ?>>)
>             unloaded
>                 .load(Thread.currentThread().getContextClassLoader(),
>                         ClassLoadingStrategy.Default.INJECTION)
>                 .getLoaded();
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)