octokit / octokit.net

A GitHub API client library for .NET
https://octokitnet.readthedocs.io/en/latest/
MIT License
2.62k stars 1.07k forks source link

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

Open rathole opened 2 months ago

rathole commented 2 months ago

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:

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

annierm18 commented 1 month ago

@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?