jerrypeng commented on issue #1988: Fix: avoid closing RuntimeFactory when any 
function stops
URL: https://github.com/apache/incubator-pulsar/pull/1988#issuecomment-398619633
 
 
   @rdhabalia @srkukarni I see the problem.  @rdhabalia you are running a 
function as a thread of the worker service right?  I don't think we should be 
creating the Pulsar client in the ThreadRuntimeFactory then.  For running 
function instances as a separate process via ProcessRuntimeFactory the workflow 
is as such:
   FunctionRuntimeManager creates ProcessRuntimeFactory and is passed to 
FunctionActioner. FunctionActioner will create a RuntimeSpawner that creates a 
new process via ProcessRuntimeFactory.  The process will run JavaInstanceMain 
which creates a ThreadRuntimeFactory and a RuntimeSpawner to spawn a thread 
runtime.  
   
   When JavaInstanceMain needs to commit suicide it should have a way to close 
PulsarClient that is used in the thread runtime.  The way to do that currently 
is closing ThreadRuntimeFactory, but as @rdhabalia pointed out that will cause 
problems for running functions as a thread.  We need a way to close the pulsar 
client when the function instance is running via process and not when the 
function instance is running as a thread in the worker service process

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to