Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Pass back real result for single task chains #6411

Merged
merged 1 commit into from Oct 14, 2020

Commits on Oct 14, 2020

  1. fix: Pass back real result for single task chains

    When chains are delayed, they are first frozen as part of preparation
    which causes the sub-tasks to also be frozen. Afterward, the final (0th
    since we reverse the tasks/result order when freezing) result object
    from the freezing process would be passed back to the caller. This
    caused problems in signaling completion of groups contained in chains
    because the group relies on a promise which is fulfilled by a barrier
    linked to each of its applied subtasks. By constructing two
    `GroupResult` objects (one during freezing, one when the chain sub-tasks
    are applied), this resulted in there being two promises; only one of
    which would actually be fulfilled by the group subtasks.
    
    This change ensures that in the special case where a chain has a single
    task, we pass back the result object constructed when the task was
    actually applied. When that single child is a group which does not get
    unrolled (ie. contains more than one child itself), this ensures that we
    pass back a `GroupResult` object which will actually be fulfilled. The
    caller can then await the result confidently!
    maybe-sybr committed Oct 14, 2020
    Copy the full SHA
    bd6c6bd View commit details
    Browse the repository at this point in the history