Skip to content

Allow a configurable operation timeout esp. in DotNetRunner - #248

Open
ransagy wants to merge 4 commits into
dotnet-outdated:masterfrom
ransagy:timeoutOption
Open

ransagy wants to merge 4 commits into
dotnet-outdated:masterfrom
ransagy:timeoutOption

Conversation

@ransagy

@ransagy ransagy commented Feb 1, 2022 •

Copy link
Copy Markdown

The hard-coded 20s timeout in DotNetRunner wasn't enough in the case of one or two of the solutions i was working on, so i added it as a configurable option and increased the default to 30s, which was enough in all my cases.

While i'm not in love with propagating a parameter everywhere, I followed the design of the no-restore and ignore-failed-sources options to not end up with too much of a big change here.

Let me know if there are other suggestions on this design and idea.

@reduckted

Copy link
Copy Markdown
Contributor

Any chance this could be looked at? The short timeout is the cause of #251 as well and makes this tool completely unusable for me. 😢

@ransagy

ransagy commented Jul 13, 2023

Copy link
Copy Markdown
Author

I don't mind rebasing my branch and having it up to date, but we need someone to sign off on the design and approve after that. @slang25 Let me know if you have the time to take a look, I'll do the rebase after.

Comment thread src/DotNetOutdated/Program.cs Resolved
var errorTask = ConsumeStreamReaderAsync(p.StandardError, errors);

var processExited = p.WaitForExit(20000);
var processExited = p.WaitForExit((int)TimeSpan.FromSeconds(timeout).TotalMilliseconds);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If breaking changes to the API surface are a concern, maybe we could just get this from an environment variable instead?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to leave magical env vars out of this unless an absolute must because it would also drag us into "what is the default? is there a default to the env var? can i setup on install/first use a default?" kind of question.
I don't mind adding the option if you think it's needed or preferable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wouldn't typically use them either, but it's a possible way to go about this if the maintainers don't want to take the binary-breaking changes to the Core library required to push through the timeout value from the command-line.

With regards to a default value, it could just be the hard-coded 20s that the current version has.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just making sure I'm in sync; So we're waiting for input on this from @coderpatros or @slang25, right?

@ransagy

ransagy commented Aug 24, 2023 •

Copy link
Copy Markdown
Author

I'm generally wondering if my change here is still relevant with the merged changes in #468

I'll update it if anyone thinks it still is.

@martincostello

Copy link
Copy Markdown
Contributor

I'm still having this problem after the changes in 4.5.3 which is what lead me here 😄

@ransagy

ransagy commented Aug 24, 2023

Copy link
Copy Markdown
Author

Got it. Will review later today and update.

@martincostello

Copy link
Copy Markdown
Contributor

@reduckted If it helps, running dotnet restore before running dotnet outdated proved a good workaround for my use case.

@reduckted

Copy link
Copy Markdown
Contributor

@martincostello ... running dotnet restore before running dotnet outdated proved a good workaround for my use case.

That's interesting. For me, the timeout change in 4.5.3 has fixed the issue I was having, although prior to that it would succeed about 5% of the time. I think the time to perform a restore must have been just over 20 seconds on average, so if all of the stars aligned, it would complete in less than 20 seconds and avoid the timeout.

How long does a restore normally take for you? I'm wondering if increasing the verbosity level of the dotnet restore call would cause it to write output more frequently, which in turn would reset the timeout more frequently.

@martincostello

Copy link
Copy Markdown
Contributor

In my case it was taking between 35-50 seconds for the restore to complete. For these apps, a custom NuGet feed is used which isn't as performant as NuGet.org, and they also have quite large dependency graphs.

@ransagy

ransagy commented Aug 26, 2023

Copy link
Copy Markdown
Author

I've rebased on latest master branch and applied the review changes, as well as a small testing harness change with the const timeout, Should be ready for re-review now.

@lioror

lioror commented Jul 19, 2024

Copy link
Copy Markdown

Hi, on our build machine 20s is too little, no output or error is written and the command fails.
Please approve this merge

@yorianpeters

Copy link
Copy Markdown

We have the same issue.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants