Bound remote installed-plugin inventory pagination (#55946)

## Why

Installed-plugin inventory fetches could keep following pagination cursors
without an overall bound, delaying release of the plugin mutation gate.

## What changed

- Limit each inventory fetch to 60 seconds and 100 pages, and reject repeated
  pagination cursors.
- Request 200 items per page for scoped inventory fetches as well as all-scope
  fetches.
- Report overall fetch timeouts as `remote_catalog_timeout`.

## Testing

Add coverage for cursor cycles, completion at the page limit, and overall
timeout cancellation after successful pages. Verify that failed pagination
preserves the cached inventory and plugin files and releases the mutation gate.

GitOrigin-RevId: e8429dd804581041d102defa9d19db02bcb1739b
This commit is contained in:
Matthew Zeng
2026-10-21 17:28:24 +00:00
committed by copyberry
parent a3b685331f
commit 9b39316997
6 changed files with 269 additions and 27 deletions
@@ -2394,6 +2394,7 @@ fn remote_plugin_catalog_error_type(err: &RemotePluginCatalogError) -> &'static
RemotePluginCatalogError::ArchiveTooLarge { .. } => "remote_catalog_archive_too_large",
RemotePluginCatalogError::MissingUploadEtag => "remote_catalog_missing_upload_etag",
RemotePluginCatalogError::UnexpectedResponse(_) => "remote_catalog_unexpected_response",
RemotePluginCatalogError::InstalledPluginsFetchTimeout => "remote_catalog_timeout",
RemotePluginCatalogError::CacheRemove(_) => "remote_catalog_cache_remove",
}
}
@@ -2463,6 +2464,7 @@ fn remote_plugin_catalog_error_to_jsonrpc(
| RemotePluginCatalogError::ArchiveJoin(_)
| RemotePluginCatalogError::MissingUploadEtag
| RemotePluginCatalogError::UnexpectedResponse(_)
| RemotePluginCatalogError::InstalledPluginsFetchTimeout
| RemotePluginCatalogError::CacheRemove(_) => internal_error(message),
}
}