minify icon indicating copy to clipboard operation
minify copied to clipboard

Python binding hangs in forked process

Open EmpireJones opened this issue 1 year ago • 7 comments

When using the Python bindings with multiprocessing (forking the process via a Pool, to parallelize the minify work), minify appears to hang.

In particular, this seems to happen when minify is imported via the main process, prior to forking the new processes.

A workaround is to ensure that the library doesn't get imported prior to forking (i.e., have the new forked processes perform the import).

I'm not sure if there's any easy library change to fix this, but I at least wanted to let others know of the workaround.

--

I'm using Python3.10.4; the installed go version is go1.17.1; Ubuntu 22.04.1.

EmpireJones avatar Sep 22 '22 19:09 EmpireJones