octokit / octokit.net

A GitHub API client library for .NET

Home Page:https://octokitnet.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]: Timeout getting multiple renamed repositories when running in NET Framework

rathole opened this issue · comments

What happened?

When the following code is built for and run with .NET Framework (target framework net472), the second call to GitHubClient.Repository.Get fails after 100 seconds with a TaskCanceledException:

using Octokit;

var gitHubClient = new GitHubClient(new ProductHeaderValue("TimeoutRepro"));

var renamedRepo1 = await gitHubClient.Repository.Get("moq", "moq");
var renamedRepo2 = await gitHubClient.Repository.Get("sandermvanvliet", "SerilogSinksInMemory");

Further observations:

  • When changing the order in which the repositories are queried, it is always the second one that fails.
  • The failure does not happen with repositories that have not been renamed.
  • The failure does not happen when targeting and running with NET 8.0

This seems to be the same issue as described in #1396 but now it only reproduces with .NET Framework.

Versions

Octokit.net 10.0.0

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

@kfcampbell I am seeing a similar issue but with:

Task<Issue> Get(string owner, string name, int number);

Repro Steps:
Note: This flow works as expected in core
Using .NetFramework v4.6.1; Octokit version 10.0.0, 11.0.0, or 11.0.1

  1. Have issue 1 in repo 1 with issue number 1 and transfer it to repo 2
  2. Have issue 2 in a repo (e.g. repo 3) with issue number 2 that shares the same GitHubClient (devRepoClientTest) as issue 1, and transfer issue 2 to another repo
  3. Then, in the program, run the following two lines of code

await devRepoClientTest.Issue.Get(org1, repo1, 1);
await devRepoClientTest.Issue.Get(org1, repo3, 2);

Expected Behavior: I would get the issue object for both calls, and the issue object would be for the new issues from the repos where they were transferred to.

Actual Behavior: I get the first issue object, but I get a "TaskCanceledException" error for the second call

Questions:
Are you able to reproduce this issue? If yes, should I create a separate bug for it?