Drop the Composer 1 default branch fallback from download tracking - #1841
Merged
Conversation
trackDownloadsAction resolved Composer 1's 9999999-dev default branch with a SELECT against package + package_version, per package, inside the per-package loop, on an endpoint that takes ~2M requests per APM period. It was the only synchronous MySQL left there - everything else resolves ids through a single Lua call against Redis - and with a 1.3s PDO connect timeout it is the most likely explanation for the endpoint's 10s tail. Support for Composer 1 was shut down on 2025-09-01, which packages.json has been announcing since. Note this is a behaviour change rather than pure removal: the few remaining Composer 1 clients hitting this path now get a 'partial' response and their downloads stop being counted, instead of being resolved via the default branch. The endpoint had no test coverage at all, so this also adds the two cases that matter: a resolvable version is counted, and an unresolvable one is reported back to the client.
Member
Author
|
I think this is an acceptable loss, composer 1 client are not so many anymore and this only affects stats for the default branch so 🤷🏻♂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
trackDownloadsActionresolved Composer 1's9999999-devdefault branch with aSELECTagainstpackage+package_version— per package, inside the per-package loop, on an endpoint taking ~2M requests per APM period.It was the only synchronous MySQL left there (everything else resolves ids through a single Lua call against Redis, and the write is a single
EVALSHA), and withPDO::ATTR_TIMEOUTat 1.3s it's the most likely explanation for the endpoint's 10.6s tail.Support for Composer 1 was shut down on 2025-09-01, which
packages.jsonhas been announcing via itswarningfield since.Important
This is a behaviour change, not a pure removal. The few remaining Composer 1 clients that hit this path now get a
partialresponse and their downloads stop being counted, instead of being resolved via the package's default branch. Given you said a few requests do still land here, that's your call — happy to close this one if you'd rather keep the resolution and instead seed a9999999-devalias into the Redisids:hash, which would keep the behaviour with no MySQL.Verification
composer phpstanclean, full suite green. The endpoint had no test coverage at all, so this adds the two cases that matter: a resolvable version is counted (201success), and an unresolvable one is reported back (200partial).