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

fix(publish): Check remote git registry more than once post-publish #11255

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

epage
Copy link
Contributor

@epage epage commented Oct 18, 2022

With publish-timeout on remote git registries, we were checking once and never checking again. There were 3 layers of guards preventing the cache from being updating

  • needs_update, handled via invalidate_cache
  • config.updated_sources(),. handled by removing from the HashSet
  • updated, inaccessible

This change collapses updated into config.updated_sources(), allowing the cache to be updated

Tested by publishing epage-publish-test. After about 7 registry updates, it succeded. Before, it just hit the timeout of 60s. No tests are added as we don't have the plumbing setup to be able to control when the test remote git registry publishes. All of our tests focus on the remote http registry.

Fixes #11253

@rust-highfive
Copy link

r? @weihanglo

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 18, 2022
With `publish-timeout` on remote git registries, we were checking once
and never checking again.  There were 3 layers of guards preventing the
cache from being updating
- `needs_update`, handled via `invalidate_cache`
- `config.updated_sources()`,. handled by removing from the HashSet
- `updated`, inaccessible

This change collapses `updated` into `config.updated_sources()`,
allowing the cache to be updated

Tested by publishing `epage-publish-test`.  After about 7 registry
updates, it succeded.  Before, it just hit the timeout of 60s.  No tests
are added as we don't have the plumbing setup to be able to control when
the test remote git registry publishes.  All of our tests focus on the
remote http registry.

Fixes rust-lang#11253
Comment on lines +310 to +311
// To fully invalidate, undo `mark_updated`s work
self.needs_update = true;
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't cargo remove source from self.config.updated_sources() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arlosi thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the intent of updated_sources was to prevent fetching the repo more than once per session for scenarios like publish (where we do an update for fetching config.json as well as a later update for the verification build).

Maybe it's not a big deal to do an extra fetch here though, since we'll be doing many more fetches with the polling for publish anyway and it would simplify things.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thinking some more about this, I feel like more investigation is needed into updated_sources before clearing it here in case there are areas that are relying on this behavior. I feel like that effort is best decoupled from the current effort.

Copy link
Member

Choose a reason for hiding this comment

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

Sound reasonable. We can deal with it afterward.

Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

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

Tested with crate weihanglo-publish-test as well. All look fine.
Thanks for the fix and @arlosi's review.

@weihanglo
Copy link
Member

@bors r=arlosi

@bors
Copy link
Contributor

bors commented Oct 20, 2022

📌 Commit dd69674 has been approved by arlosi

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 20, 2022
@bors
Copy link
Contributor

bors commented Oct 20, 2022

⌛ Testing commit dd69674 with merge a6e72d0...

@bors
Copy link
Contributor

bors commented Oct 20, 2022

☀️ Test successful - checks-actions
Approved by: arlosi
Pushing a6e72d0 to master...

@bors bors merged commit a6e72d0 into rust-lang:master Oct 20, 2022
@epage epage deleted the registry branch October 20, 2022 12:26
bors pushed a commit to rust-lang-ci/rust that referenced this pull request Oct 22, 2022
5 commits in 3ff044334f0567ce1481c78603aeee7211b91623..071eeaf210708219a5a1b2c4728ca2f97df7f2ae
2022-10-17 20:25:00 +0000 to 2022-10-22 01:17:55 +0000

- fix: Remove leading newline in vendor output (rust-lang/cargo#11273)
- Fix publishing with a dependency on a sparse registry (rust-lang/cargo#11268)
- Add missing edition (rust-lang/cargo#11265)
- fix(publish): Check remote git registry more than once post-publish (rust-lang/cargo#11255)
- Fix typo (rust-lang/cargo#11258)
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 22, 2022
Update cargo

5 commits in 3ff044334f0567ce1481c78603aeee7211b91623..071eeaf210708219a5a1b2c4728ca2f97df7f2ae 2022-10-17 20:25:00 +0000 to 2022-10-22 01:17:55 +0000

- fix: Remove leading newline in vendor output (rust-lang/cargo#11273)
- Fix publishing with a dependency on a sparse registry (rust-lang/cargo#11268)
- Add missing edition (rust-lang/cargo#11265)
- fix(publish): Check remote git registry more than once post-publish (rust-lang/cargo#11255)
- Fix typo (rust-lang/cargo#11258)

r? `@ghost`
@ehuss ehuss added this to the 1.66.0 milestone Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

publish-timeout not receiving updated index
6 participants