rdhabalia commented on issue #1988: Fix: avoid closing RuntimeFactory when any function stops URL: https://github.com/apache/incubator-pulsar/pull/1988#issuecomment-398593971 > RuntimeFactory is used on a per function instance basis. RuntimeFactory is not used across different functions. Umm.. really? Isn't RuntimeFactory created one per worker because it's job is to create Runtime for instance. and it seems it's also implemented in such a manner where worker creates one RuntimeFactory which will be used to create runtime for new function-instance. [WorkerService](https://github.com/apache/incubator-pulsar/blob/master/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/WorkerService.java#L107) -> creates [FunctionRuntimeManager](https://github.com/apache/incubator-pulsar/blob/master/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionRuntimeManager.java#L110) -> creates `RuntimeFactory` which is being passed to [FunctionActioner](https://github.com/apache/incubator-pulsar/blob/master/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionRuntimeManager.java#L122) and FunctionActioner uses RuntimeFactory to create runtime for a function-instance. Now, if I delete/update a function then it closes a RuntimeFactory and it's pulsar-client so, any new function will be failed with given exception: `Client is already closed`.
---------------------------------------------------------------- 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
