irods / contrib

A pooled collection of community-contributed code that works alongside iRODS
BSD 3-Clause "New" or "Revised" License
13 stars 19 forks source link

create msifree_microservice_out #7

Closed kellerb closed 8 years ago

kellerb commented 8 years ago

This microservice can be used to fix leaks like those in https://github.com/irods/irods/issues/2929.

Currently implemented to free the output of:

kellerb commented 8 years ago

To build and install (example based on Ubuntu 14 iRODS 4.1.6):

  1. Install the appropriate iRODS development package:
    • wget ftp://ftp.renci.org/pub/irods/releases/4.1.6/ubuntu14/irods-dev-4.1.6-ubuntu14-x86_64.deb
    • sudo dpkg -i irods-dev-4.1.6-ubuntu14-x86_64.deb
  2. git clone https://github.com/irods/contrib
  3. cd contrib/microservices/administration/
  4. fakeroot ./packaging/build.sh
  5. sudo dpkg -i build/irods-contrib-microservices-administration-1.0.deb

This will enable the use of msifree_microservice_out() in rules.

msiExecCmd("hello", "null", "null", "null", "null", *exec_cmd_out);
msiGetStdoutInExecCmdOut(*exec_cmd_out, *stdout);
msifree_microservice_out(*exec_cmd_out); # DO NOT use *exec_cmd_out after this
writeLine("stdout", *stdout); # Note that *stdout can still be used
*i = errorcode(msifree_microservice_out(*stdout)); # Free'ing unsupported types is an error
if *i != -323000 then fail(-1) else 0
erastova commented 8 years ago

Hi @kellerb ,

I want to confirm that all my tests went well. Thanks for providing this microservice! I wonder do you plan to include it in 4.1.8?

cheers, elena

kellerb commented 8 years ago

Thank you for testing and replying.

The plan is to leave it in contrib, so that we can advance it independently from the main server software. This will allow us to release updates to the microservice that handle the cleanup of other types of microservice out variables, without requiring users to upgrade their entire installation.

erastova commented 8 years ago

ok! thanks!