Skip to content

Apps-Engine Deno runtime sendRequest can hang forever because it has no response timeout #41798

Description

@karthik120710

Description:

In messenger.ts, the sendRequest function creates a responsePromise that waits indefinitely for a response:${request.id} event on RPCResponseObserver. If the Deno subprocess never returns a response, the promise remains pending and the caller is blocked. Additionally, the request id is generated using Math.random(), which is not ideal for unique IDs.

Expected behavior:

sendRequest should reject after a reasonable timeout and clean up the event listener, so pending requests cannot leak or hang the process forever.

Suggested fix:

Race the response promise against a setTimeout promise.
Remove the event listener in both the success/timeout cases.
Consider replacing the Math.random() id with crypto.randomUUID() or a sequential/counter-based id.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions