Skip to content

Deno: deno run does not exit #2079

@gr2m

Description

@gr2m

Follow up to #2075

What happened?

@laughedelic was able to narrow down the problem to the throttle plugin.

import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
import { throttling } from "https://cdn.skypack.dev/@octokit/plugin-throttling";
const MyOctokit = Octokit.plugin(throttling);
const octokit = new MyOctokit({
  auth: Deno.env.get("GITHUB_TOKEN"),
  throttle: {
    onRateLimit: (retryAfter: any, options: any, octokit: any) => {
      return true;
    },
    onAbuseLimit: (retryAfter: any, options: any, octokit: any) => {
      octokit.log.warn(`Abuse detected for request ${options.method} ${options.url}`);
    },
  },
});

octokit.log.warn("foo");

It prints foo and hangs. If I remove everything related throttling, it prints the message and exits.

A workaround for this hanging is to add Deno.exit(0) at the end.

What did you expect to happen?

The deno process should exit, just like Node does

What the problem might be

The throttle plugin is using bottleneck by @SGrondin. Maybe it's a known issue?

I'd appreciate if someone with more deno experience could try to reproduce the hanging problem with just Bottleneck. The sourcecode where we use bottleneck is here: https://github.com/octokit/plugin-throttling.js/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Up for grabsIssues that are ready to be worked on by anyoneType: BugSomething isn't working as documenteddeno

    Type

    Projects

    Status

    🔥 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions