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 2019/08/16 09:21:47 UTC

[GitHub] [pulsar] freeznet opened a new issue #4969: FD leakage found in FunctionActioner.downloadFile

freeznet opened a new issue #4969: FD leakage found in FunctionActioner.downloadFile
URL: https://github.com/apache/pulsar/issues/4969
 
 
   **Describe the bug**
   When function package downloaded from bookkeeper, a new `FileOutputStream` passed to `WorkerUtils.downloadFromBookkeeper`, but `WorkerUtils.downloadFromBookkeeper` dosent close `FileOutputStream`, which cause the `FileOutputStream` as a leaked fd.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   - docker standalone pulsar v2.4.0
   - use pulsar admin to create a new function with golang
   - wait for pulsar finish the command and tries to run the function as a process
   - got error `java.io.IOException: Cannot run program "/tmp/pulsar_functions/transient/stream/steady-voltage-handler/0/steady-voltage-handler": error=26, Text file busy`
   - using `lsof` to check who is using the fd, we can see possible fd leakage shown below.
   ```
   root@f7e2600f85bc:/tmp/pulsar_functions/transient/stream/steady-voltage-handler/0# lsof ./steady-voltage-handler
   COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
   java      1 root 1027w   REG   8,18 13332768 32374801 ./steady-voltage-handler
   root@f7e2600f85bc:/tmp/pulsar_functions/transient/stream/steady-voltage-handler/0# lsof -a -p 1 | grep "(deleted)"
   java      1 root 1027w      REG               8,18  13332768  32374801 /tmp/pulsar_functions/transient/stream/steady-voltage-handler/0/steady-voltage-handler.0.da02f683-854f-4049-9512-da1fa667b2d0 (deleted)
   java      1 root 1035w      REG               8,18     13179  32374810 /tmp/pulsar_functions/public/default/wheeltest/0/pulsar_function_test-1.0-py3-none-any.whl.0.6c9273c9-7405-4d0f-a227-7baaf6dc55cb (deleted)
   java      1 root 1036w      REG               8,18     13835  32374817 /tmp/pulsar_functions/transient/stream/transientHandler/0/transient_handler-1.0-py3-none-any.whl.0.3ca67b27-0dd3-44bb-97a0-37abc359c789 (deleted)
   ```
   - we use `gdb --pid=1` and `p close(1027)` (1027 was the fd bind to our golang function executable) to test if `Text file busy` was caused by fd leaked, and after we close the fd and quit `gdb`, the function can be execute.
   

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


With regards,
Apache Git Services