irods / contrib

A pooled collection of community-contributed code that works alongside iRODS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

create msifree_microservice_out

kellerb opened this issue · comments

This microservice can be used to fix leaks like those in irods/irods#2929.

Currently implemented to free the output of:

  • msiExecCmd()

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

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

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.

ok! thanks!