Skip to content

Add a parser timeout to prevent event-loop blocking #23

Closed

Description

@DataDave-Dev

In src/lib/analysis/analyzers/shared.ts (parseFile, ~line 162) parser.parse(content) runs with no time budget. A pathological input can block the Node event loop indefinitely.

Fix: call parser.setTimeoutMicros(5_000_000) before parse(), catch the resulting error and reject that file gracefully. Small, well-scoped change — good first issue.


En src/lib/analysis/analyzers/shared.ts (parseFile, ~línea 162) parser.parse(content) corre sin límite de tiempo. Una entrada patológica puede bloquear el event loop de Node indefinidamente.

Fix: llamar parser.setTimeoutMicros(5_000_000) antes de parse(), capturar el error y descartar ese archivo con elegancia. Cambio pequeño y acotado — good first issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions