Prevent zip:zip_open/1,2 from leaking ports
Daniel White <[email protected]> Sat, 17 Jan 2015 19:51:24 +1100
| Newsgroups | gmane.comp.lang.erlang.patches |
|---|---|
| Message-ID | <CAMD5n_215LgD=iJJku=sgDczQZPfehpLMRM+PkH5NE1wS9W5BA@mail.gmail.com> |
The case was discovered where a parent process would exit before closing the zip file. The result was that a port would be left open indefinitely, as the small zip server would not detect this condition. By comparison, the file module will close the associated port when the parent exits for any reason. This change would make the zip module more consistent with the semantics of similar modules. This change is breaking for any callers expecting to pass the handle to another process for processing (assuming it exits). With this in mind, it may need a bit more thought with regards to: 1. Is this the best way to cope with a parent process exiting? 2. Should an equivalent of gen_tcp:controlling_process/2 to deal with migrating an open zip to another process? 3. If backwards compatibility is necessary, then would it be worth introducing new functions without the "zip_" prefix? git fetch git://github.com/danielwhite/otp.git zip-port-leak-fix https://github.com/danielwhite/otp/compare/erlang:master...zip-port-leak-fix https://github.com/danielwhite/otp/compare/erlang:master...zip-port-leak-fix.patch https://github.com/erlang/otp/pull/587 -- Daniel White _______________________________________________ erlang-patches mailing list [email protected] http://erlang.org/mailman/listinfo/erlang-patches