Skip to content

Can no longer force stop an HTTP server task #154

Open
@zarqman

Description

@zarqman

Since #153, it seems that task.stop can no longer forcefully stop an HTTP server task.

In testing, consider something like this:

### async-http enabled app
server = Async::HTTP::Server.new(...)
server_task = Async{ server.run }

# make a request to the server's endpoint, which in turn talks to a remote origin
# that remote origin uses http1.1 with the default/implied Connection: keep-alive

server_task.stop
# this hangs until the keep-alive connection to origin finally times out, which could be awhile

In practice, this is causing lengthy timeouts in the test suite here (jumped from around 1 minute to over an hour). The delays are coming during requests to http1.1 origins. Reverting task.defer_stop to begin in Async::HTTP::Protocol::HTTP1::Server#each resolves the issue. On the surface, the comparable change in ...HTTP2::Server doesn't seem to be as much of a problem.

While at least part of it is in our tests, and could potentially be worked around, I'm also concerned about stuck tasks (even if due to other bugs) and that there won't be a way to kill them in a timely fashion apart from kill -9.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions