Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pub upgrade" sometimes hangs for around 30s after it appears to have finished #4256

Closed
DanTup opened this issue May 2, 2024 · 2 comments
Closed
Labels
needs-info Additional information needed from the issue author

Comments

@DanTup
Copy link

DanTup commented May 2, 2024

While investigating dart-lang/sdk#55621 I found that sometimes pub upgrade is just hanging at the end for around 30s:

image

All of the output shown here appeared almost immediately, then the process took over 20 seconds more to exit.

If I run with -v I see lots of output that seems like it may be retrying requests many times, but there is no information about why:

IO  : Attempt #5 for fetching versions for "stream_channel" from "https://pub.dev/api/packages/stream_channel"
IO  : HTTP GET https://pub.dev/api/packages/stack_trace
    | Accept: application/vnd.pub.v2+json
    | X-Pub-OS: windows
    | X-Pub-Command: upgrade
    | X-Pub-Session-ID: BA637EE2-3F42-4AE2-86C6-004FF2C77BAA
    | user-agent: Dart pub 3.3.0
IO  : Attempt #5 for fetching versions for "stack_trace" from "https://pub.dev/api/packages/stack_trace"
IO  : HTTP GET https://pub.dev/api/packages/boolean_selector
    | Accept: application/vnd.pub.v2+json
    | X-Pub-OS: windows
    | X-Pub-Command: upgrade
    | X-Pub-Session-ID: BA637EE2-3F42-4AE2-86C6-004FF2C77BAA
    | user-agent: Dart pub 3.3.0
IO  : Attempt #5 for fetching versions for "boolean_selector" from "https://pub.dev/api/packages/boolean_selector"
IO  : HTTP GET https://pub.dev/api/packages/test_api
    | Accept: application/vnd.pub.v2+json
    | X-Pub-OS: windows
    | X-Pub-Command: upgrade
    | X-Pub-Session-ID: BA637EE2-3F42-4AE2-86C6-004FF2C77BAA
    | user-agent: Dart pub 3.3.0
IO  : Attempt #5 for fetching versions for "test_api" from "https://pub.dev/api/packages/test_api"

It's not clear to me if this content is buffered and may have completed very quickly, or if it might be happening during the "hang" at the end (it seems to me like important requests for handling the upgrade, but the output suggests that completed very quickly?).

This was repro'd using current stable.. Is there anything I can do to get more information about what's going on during the hang?

@sigurdm
Copy link
Contributor

sigurdm commented May 6, 2024

I believe this is a duplicate of dart-lang/sdk#55289
Fixed in dart-lang/sdk@8acb0a4

Can you reproduce on main/latest dev?

@sigurdm sigurdm added the needs-info Additional information needed from the issue author label May 6, 2024
@DanTup
Copy link
Author

DanTup commented May 7, 2024

Ah! I cannot repro on the latest bleeding edge, so this looks like it.

I've had this hang before from not closing HttpClient too, it should've occurred to me 🙃

@DanTup DanTup closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Additional information needed from the issue author
Projects
None yet
Development

No branches or pull requests

2 participants