Skip to content

luci/gae prod Context derivation doesn't assume Done or Cancellable state. #59

Open

Description

@danjacques

Currently, impl/prod operates on a base AppEngine Context despite the Context that the user supplies. To reduce the impact of this, an effort is made to copy any Deadline parameters from the user's Context into the derived single-use Context that impl/prod uses to talk to AppEngine.

Unfortunately, this does not copy the Done or cancellable state in the user's Context, making this a bit inconsistent. There isn't really a great way to copy cancellable without spawning a goroutine every time a new operation happens, which seems fairly expensive in performant code. We may be able to handle already-cancelled Contexts, but that is likely not a primary use case.

  • use goroutines to reproduce cancellation
  • use a single goroutine to poll all Context's that we care about and signal/callback if they are cancelled (ew). It'd have to be an iterative poll, since a select can't be built in advance.
  • rework how Context derivation happens so we can piggyback directly off the user's Context. I think I prefer this one.

edit (iannucci): # -> checkboxen

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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