dominikschulz/Log-Tree

Change IO::Interactive dependency to use IO::Interactive::Tiny instead

Closed this issue · 2 comments

IO::Interactive has a few problems, some of which have bitten myself and my colleagues recently.

  • It creates pipes at startup, which then persist for process (and child process) lifetimes. This can run a system/user out of pipe file descriptors if many processes exist.
  • It supports fork-and-exit based backgrounding in some of its utility functions. If installed, there's a temptation to use it for that backgrounding, which causes nasty performance side effects if the code fork-and-exiting is running a really big (10s of GB) Perl resident set. This risk is present with anything that forks (which we've been trying to weed out), and with raw uses of fork itself, but those are easier to lint/critic for.
  • It has a bunch of dependencies that you technically don't need if you only want to use the is_interactive function, if you care about that sort of thing. I don't, personally.

Those are minor quibbles that most people don't care about, but can easily and provably be resolved by using the IO::Interactive::Tiny module, which is just a method extract of the is_interactive method from IO::Interactive, without the rest of the functions and their associated cruft as mentioned above.

TL;DR

IO::Interactive has sketchy side effects and dangerous functions that Log::Tree doesn't use; IO::Interactive::Tiny does not. Log::Tree is one of the last dependencies on handle-leaking/forking code in our codebase, and we like using it. Would it be possible to update Log::Tree to use IO::Interactive::Tiny instead of IO::Interactive?

Of course. Released 0.18 with the fix to CPAN just now.

Thanks!