Skip to content

Drop of http::Client::send Future causes trap, and related tribulations  #31

@pchickey

Description

@pchickey

If you drop the http::Client::send future, e.g. with a FutureExt::timeout here c184831 , wasmtime will trap because the parent resourceFutureIncomingResponse is dropped before its child Pollable.

One way to fix that is to replace the Future rust generates from the async fn with a struct of our own with the field ordering such that the child Pollable drops first, e.g. https://github.com/yoshuawuyts/wstd/blob/pch/scratchpad_reactor_refactors/src/http/client.rs#L33-L46 https://github.com/yoshuawuyts/wstd/blob/pch/scratchpad_reactor_refactors/src/http/client.rs#L83-L115

This restructuring motivated me to make Reactor::wait_for take a &Pollable instead of take ownership e.g. c740f1b which in turn creates more problems - now a simple task::sleep will panic.

The plan currently is we need to refactor the executor to resolve the architectural problems this revealed.

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