Skip to content

Service Quotas: HandleRequest discards RequestContext, so every quota-increase request files under 000000000000 #624

Closed

Description

@scttfrdmn

Found while implementing #620. Not a blocker for it, so it is filed rather than folded in.

What happens

ServiceQuotasPlugin.HandleRequest discards its *RequestContext:

// emulator/servicequotas_plugin.go
func (p *ServiceQuotasPlugin) HandleRequest(_ *RequestContext, req *AWSRequest) (*AWSResponse, error) {

so the three operations that persist per-account state have no caller to file it under, and each hardcodes a placeholder with the same comment:

accountID := "000000000000" // Use a placeholder account ID since RequestContext is not passed here.

That appears in requestServiceQuotaIncrease, listRequestedServiceQuotaChangesByService and getRequestedServiceQuotaChange. The state keys are built from it — increaseKey(accountID, id) is "quota_increase:" + accountID + "/" + id.

Why it matters

Every quota-increase request from every account lands in one shared bucket. Two consequences, neither of which raises an error:

  • A test that vends or assumes into a second account sees the first account's quota-increase requests in ListRequestedServiceQuotaChangesByService. Against real AWS the two accounts are isolated, so a multi-account governance test passes locally for the wrong reason.
  • The stored requests are attributed to an account that does not exist. Anything that later joins quota-increase history to a real account ID — an inspection of the event log, or a CaseId-style correlation — cannot.

It also blocks the natural extension of #620: L-E619E033 (accounts per organization) is adjustable, and the interesting story is a per-organization ceiling that a management account raises. That story is per-account by definition.

Fix

Thread the context through, as every other plugin does. HandleRequest already receives it; the three handlers need it passed down, and the placeholder plus its three comments go away. Compare emulator/organizations_plugin.go, where each handler takes (reqCtx *RequestContext, req *AWSRequest).

The existing keys are the migration question: state written under 000000000000 by an older run is not readable under a real account ID afterwards. Since substrate's state is per-run test state rather than durable data, dropping it is almost certainly right — worth stating in the changelog rather than silently changing.

Acceptance criteria

  • HandleRequest passes *RequestContext to the handlers that need it
  • RequestServiceQuotaIncrease files the request under reqCtx.AccountID
  • ListRequestedServiceQuotaChangesByService and GetRequestedServiceQuotaChange read the caller's own requests only
  • A test asserting two accounts do not see each other's quota-increase requests
  • The 000000000000 placeholder and all three of its comments are gone
  • The key-format change is noted in CHANGELOG.md

Activity

  1. added
    type: bug
    area: quotas
    priority: medium
    on Aug 14, 2026
  2. added this to the v0.99.0 milestone on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: quotaspriority: mediumtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions