You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/05/10 02:47:08 UTC

[GitHub] [pulsar] david-streamlio opened a new issue #6931: LocalRunner is Broken

david-streamlio opened a new issue #6931:
URL: https://github.com/apache/pulsar/issues/6931


   **Describe the bug**
   The LocalRunner class does not start a local thread runner instance for Java functions.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Create an instance of the LocalRunner class inside a Java class
   2. Initialize it like so.
   ` FunctionConfig functionConfig = 
   	    	FunctionConfig.builder()
   	    	.className(WordCountFunction.class.getName())
   	    	.inputs(Collections.singleton(TOPIC))
   	    	.inputSpecs(inputSpecs)
   	    	.maxPendingAsyncRequests(Integer.valueOf(500))
   	    	.name("word-counter")
   	    	.runtime(FunctionConfig.Runtime.JAVA)
   	    	.build();
   
   	    LocalRunner localRunner = 
   	    	LocalRunner.builder()
   	    		.brokerServiceUrl(BROKER_URL)
   	    		.stateStorageServiceUrl("bk://localhost:4181")
   	    		.functionConfig(functionConfig)
   	    		.build();
   	    
   	    localRunner.start(true);`
   3. Attach to the process with a debugger and set a breakpoint at line 360 of the LocalRunner class and attempt to step through to line 361
   4. See a "silent" NullPointerException is thrown in the following call; 
   `instanceConfig.setMaxPendingAsyncRequests(functionConfig.getMaxPendingAsyncRequests());`  This is because the call to `getMaxPendingAsyncRequests()` returns null, even though I set it to a value in the FunctionConfig
   
   **Expected behavior**
   One would expect the value I passed in to be set and for the LocalRunner to start the function inside a local thread
   
   **Screenshots**
   If applicable, add screenshots to help explain your problem.
   
   **Desktop (please complete the following information):**
    - OS: [e.g. iOS]
   
   **Additional context**
   I have the code fix and will attach it to this ticket. Basically the issue is that there is a default value for that field inside the FunctionConfig class that is set as a direct assignment. However, since the class is Lombok annotated, that assignment gets ignored AND prevents assignments from occurring inside the builder as well.
   
   I have removed that assignment, and added an equivalent logic block to the `FunctionConfigUtils.inferMissingArguments` method to set a default value of 1000 if none is provided.
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] sijie closed issue #6931: LocalRunner is Broken

Posted by GitBox <gi...@apache.org>.
sijie closed issue #6931:
URL: https://github.com/apache/pulsar/issues/6931


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] sijie commented on issue #6931: LocalRunner is Broken

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6931:
URL: https://github.com/apache/pulsar/issues/6931#issuecomment-630446305


   Fixed by #6936 


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] jiazhai commented on issue #6931: LocalRunner is Broken

Posted by GitBox <gi...@apache.org>.
jiazhai commented on issue #6931:
URL: https://github.com/apache/pulsar/issues/6931#issuecomment-626272330


   Thanks @david-streamlio 


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] david-streamlio commented on issue #6931: LocalRunner is Broken

Posted by GitBox <gi...@apache.org>.
david-streamlio commented on issue #6931:
URL: https://github.com/apache/pulsar/issues/6931#issuecomment-626264450


   Please assign this to me, I already have the code fixed locally and have confirmed it is working as expected.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org