Skip to content

New header_rewrite set-body-from operator could hypothetically lock up Transaction State Machine #11549

@ywkaras

Description

@ywkaras

The execution of the set-body-operator initiates an internal URL fetch:

TSFetchUrl(static_cast<const char *>(req_buf), req_buf_size, reinterpret_cast<struct sockaddr const *>(&addr), fetchCont,

This execution function runs in the READ_RESPONSE_HDR Txn hook. The operator then runs a continuation on the SEND_RESPONSE_HDR Txn hook, that does not call TSHttpTxnReenable(). The intent is that the hook processing is reenabled once the internal URL fetch completes, here:

TSHttpTxnReenable(http_txn, TS_EVENT_HTTP_ERROR);

But, it is not clear there is a mechanism that will prevent the internal fetch from being completed before the operator's continuation runs on the SEND_RESPONSE_HDR. Also, if other continuations on a Txn hook also uses indirect reenabling, the reenable for the fetch completing could effectively reenable the wrong continuation.

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