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
Eventual consistency issues when publishing many packages at once #7717
Comments
Where does it say that? I think we recently made it 2 minutes, so I'd like to update all messages to be more correct.
Yeah, we recently changed Honestly, we tried going for 10 minutes, but that caused a lot of push back from people manually publishing dependent packages. Caching gives us faster responses and better reliability. I think that in the future we should consider being even more aggressive about caching. In practice, it rarely matters to package consumers if a new version of a package comes out in 30s, 2 minutes or 30 minutes. Long term, as in: some day in a far fetched future, maybe we could have a feature where package authors could stage new versions on pub.dev; test and update staged versions, perhaps even release multiple staged versions together. This would be cool, and it would be the solution to caching issues like this. At the moment, I suspect that the benefit of faster responses and increased reliability benefits a lot of people. Where as the mono-repository publishing issues, only affects a few very advanced package authors. Workaround with
|
Also filed dart-lang/site-www#5803 to update documentation to cover |
Problem
TL;DR - Pub says that a package version does not exist for up to ~30 seconds after it has been published.
I am one of several maintainers of a large monorepo. There are a few dozen packages in this repo, many of which depend on each other and often get published at the same time. When we publish packages we create a dependency graph and start publishing all the leaf nodes and then work up each branch until all the packages are published. This is automated. This ensures package_b is not published before package_a if package_b depends on package_a. This is important when package_b depends on the latest version of package_a and both are being published at the same time.
This use to work great. More recently we have seen issues where after package_a version x.y.z is published, publishing package_b fails with
Because package_b depends on package_a ^X.Y.Z which doesn't match any versions, version solving failed.
If we wait around 10 seconds sometimes the publish command works on the second try. Sometimes it takes as long as 30 seconds to recognize that package_a ^X.Y.Z does exist.
This makes it very hard to automate our publishing process. We currently use a script to publish, which is kicked of by a human. In the future we would like to fully automate this. This issue makes this error prone as the best solution that I can think of is to wait ~1 minute after each publish command.
Expected behavior
Once a package is published, pub should not say it does not exist
Actual behavior
Once a package is published, pub sometimes says it does not exist
The text was updated successfully, but these errors were encountered: