[Xapian-tickets] [Xapian] #583: Spin off Omega's filetype conversion code as a library
Xapian
nobody at xapian.org
Fri Aug 18 05:33:45 BST 2023
#583: Spin off Omega's filetype conversion code as a library
-------------------------+-------------------------------
Reporter: Olly Betts | Owner: Olly Betts
Type: enhancement | Status: new
Priority: low | Milestone:
Component: Omega | Version:
Severity: normal | Resolution:
Keywords: | Blocked By:
Blocking: | Operating System: All
-------------------------+-------------------------------
Comment (by Olly Betts):
> posix_spawn can use vfork on glibc and musl to avoid the overhead of
forks which are followed by execve.
It's limited in what can be done in the new process before the `exec()`
though - in particular we currently set resource limits there (to reduce
the impact a runaway filter can have) which `posix_spawn()` doesn't appear
to support.
Setting resource limits in the main `omindex` process before calling
posix_spawn()` which are then inherited by the new process seems liable to
cause problems (e.g. if `omindex` is already using more memory than we
want to limit the new child process to). Maybe we could use the Linux-
specific `prlimit()` to set them from the parent after `posix_spawn()`,
but that limits the new code to Linux.
I think it probably makes more sense to put the effort into moving
launching filter programs to a plugin instead. That could probably set
the resource limits in the plugin process and call `posix_spawn()` though
the plugin process should have a small memory usage and so the slow
`fork()` case shouldn't be something we run into anyway.
--
Ticket URL: <https://trac.xapian.org/ticket/583#comment:8>
Xapian <https://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list