Skip to content

ability to ignore client abort when using js_content as content handler #955

@ivan-u7n

Description

@ivan-u7n

Is your feature request related to a problem? Please describe

in my js_content handler for a http request:

  1. a value is increased in a shared zone
  2. a subrequest (via r.subrequest()) is performed (to internal fastcgi-location if that matters)
  3. that value is decreased

however, if the client terminates the connection when r.subrequest() is in progress, the VM (I use QuickJS by the way) is just terminated and the value is stuck increased; all I get is [error] pending events while closing request in the error log

Describe the solution you'd like

a directive like js_content_ignore_user_abort (akin to proxy_ignore_user_abort or fastcgi_ignore_user_abort) that when turned on, will make JS VM behave as the counterparts from proxy and fastcgi modules do to proxied requests

Describe alternatives you've considered

I tried try ... finally to no avail, the VM is just terminated

for now as a workaround I use js_periodic to clean such values, but I'd like not to have to

Additional context

the js_content handler in question is used as the image processor

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