Skip to content

coroutine make_request was never awaited during sl pr pull #583

Closed

Description

@zsol

While running sl pr pull SOME_PR when HEAD points to an already landed pr (different from SOME_PR), I get the following:

warning: failed to read from Github for landed commits (RuntimeError('This event loop is already running')), not marking commits as landed
D:\a\sapling\sapling\eden\scm\edenscm\ext\github\pr_marker.py:49: RuntimeWarning: coroutine 'make_request' was never awaited

This is likely due to the use of sync_graphql calls while already in an asyncio loop in pr_marker.py

Activity

  1. zzl0 commented on Mar 25, 2023

    @zzl0
    Contributor

    Hi @zsol, thanks for posting the issue and steps to reproduce it. Yes, the issue here is the nested async event loops, this was due to a recent change of moving pr_marker inline instead of as a separate hook.

    We probably can solve it by using nest_asyncio, but I will check if we can eliminate the nested event loop next week. For now, you can add below config to your config file by running sl config -e to disable pr_marker, and run sl debugprmarker manually if you want to hide landed PRs.

     [github]
     hide-landed-commits=False
    

    Below is the trace stack (simplified) of the nested event loop:

    import_pull_request.get_pr(ui, repo, *args, **opts)
    ...
    return asyncio.run(_get_pr(ui, repo, pr_id=pr_id, is_goto=is_goto)) # <-- First event loop
    ...
    git.pull(self, source, names=bookmarknames, nodes=headnodes)
    ...
    _pull(orig, repo, source, names=(), nodes=())
    ...
    pr_marker.cleanup_landed_pr(repo)
    ...
    response = github.graphql_sync(query, owner=pr.owner, name=pr.name, number=pr.number) # <-- Second event loop
    
  2. self-assigned this
    on Mar 25, 2023
  3. added
    fix readyA fix was created. It's pending review or push.
    on Mar 25, 2023
  4. zzl0 commented on Apr 3, 2023

    @zzl0
    Contributor

    Fixed in 3f6cd0c

    Madepr_marker run as a post-pull hook instead of running it as part of the pull function (via a high-order wrapper function).

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

Metadata

Metadata

Assignees

Labels

bugfix readyA fix was created. It's pending review or push.pr

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions