Skip to content

mix gettext.extract --merge still times out on large projects (120s limit from #417) #440

Description

@mstroeck

mix gettext.extract --merge crashes on our codebase because the merge step added in #417 runs with a fixed 120-second timeout:

** (exit) exited in: Task.Supervised.stream(120000)
    ** (EXIT) time out
    (elixir 1.19.5) lib/task/supervised.ex:349: Task.Supervised.stream_reduce/7
    (elixir 1.19.5) lib/stream.ex:707: Stream.run/1
    (gettext 1.0.2) lib/mix/tasks/gettext.extract.ex:85: Mix.Tasks.Gettext.Extract.run_message_extraction/3

gettext 1.0.2, Elixir 1.19.5, OTP 28.

I know #416 already covered this once: the old 5s default got raised to 120s, and the review landed on a fixed value rather than :infinity because of CI concerns. Fair enough, but 120s is still a ceiling, and we're well past it. Our app has ~3,300 files and a default.po with ~10k messages across 5 domains; the merge alone takes about 6 minutes on an Apple Silicon laptop. So the task dies every single run.

Two details that make it worse in practice:

  1. The crash lands after the POT files (and some of the smaller PO files) are already written, so you're left with a half-updated working tree and a raw Task.Supervised.stream exit that gives no hint what happened.
  2. Standalone mix gettext.merge doesn't have this limit: its own Task.async_stream uses timeout: :infinity (lib/mix/tasks/gettext.merge.ex:213). Running mix gettext.extract && mix gettext.merge priv/gettext works fine on the same project. Having the ceiling only on the combined flag seems unintentional.

Would you take a PR that makes the timeout configurable, say via the project's :gettext config or a --merge-timeout flag, keeping 120s as the default? Failing that, even a note in the task docs pointing at the two-step workaround would help the next person who hits this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions