Skip to content

RateLimitTransport incompatible with v4 api #849

Closed

Description

@lijok

v4, graphql api, uses POST for all operations, including read
RateLimitTransport sleeps for 1s between each POST/PATCH/PUT/DELETE operation
Say you have 100 repos with 3 branch protection rules each, the provider will spend 5 minutes sleeping

Activity

  1. added
    Type: Bug
    on Jul 21, 2021
  2. ayk33 commented on Jul 27, 2021

    @ayk33

    Anything that can be done about this?

  3. lijok commented on Jul 28, 2021

    @lijok
    Author

    the provider needs to either not use v4 api, which is probably not wise long-term
    or, rethink the RateLimitTransport

  4. majormoses commented on Sep 28, 2021

    @majormoses
    Contributor

    I think its important to keep the RateLimitTransport for any v3 api interactions for larger organizations where we need to rely on this to get through plans in our largest states. In the graphql api I agree we need to think about rate limits very differently.

    Here is the docs from Github: https://docs.github.com/en/graphql/overview/resource-limitations#rate-limit

    What I think we want to do is create a generic rate limit transport and then let each rest and gql apis use the appropriate transport based on the calls.

  5. jcudit commented on Oct 5, 2021

    @jcudit
    Contributor

    The latest release contains a possible fix for your use case. Can you take a look at the new write_delay_ms configuration parameter and let us know if this can be closed?

  6. lijok commented on Oct 5, 2021

    @lijok
    Author

    @jcudit thanks for that
    set write_delay_ms to 200, which has on average sped up our plan times 2x
    image
    Lowering this value further yields marginal gains (100ms = ~6m30s)

    However, while the PR that introduces write_delay_ms option helps this problem, I think long term it's not the correct solution for it. I think the provider should have separate transports for v4 and v3 api's, keeping the rate limit logic as is on the v3 api, but modifying the v4 api transport to only invoke this write delay on mutations, rather than queries

    Any thoughts?

  7. shoddyguard commented on Oct 6, 2021

    @shoddyguard

    I would have to agree that while #907 certainly helps (and is very much appreciated) it's not the solution.

    As @lijok mentions It would be good to differentiate between the API's and have appropriate logic between them, this is only going to become more of a problem as more things move to the newer API.

  8. majormoses commented on Oct 7, 2021

    @majormoses
    Contributor

    I think its important to keep the RateLimitTransport for any v3 api interactions for larger organizations where we need to rely on this to get through plans in our largest states. In the graphql api I agree we need to think about rate limits very differently.

    Here is the docs from Github: https://docs.github.com/en/graphql/overview/resource-limitations#rate-limit

    What I think we want to do is create a generic rate limit transport and then let each rest and gql apis use the appropriate transport based on the calls.

    If we go this route we can start with adding a no-op rate limit transport for GQL apis and use the existing rate limiter for REST.

  9. github-actions commented on Nov 30, 2022

    @github-actions

    👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

  10. added
    Status: Stale
    on Nov 30, 2022
  11. shoddyguard commented on Nov 30, 2022

    @shoddyguard

    This definitely still needs addressing

  12. added
    Status: Needs info
    and removed
    Status: Stale
    on Dec 1, 2022
  13. 12 remaining items

  14. stevehipwell commented on Oct 21, 2024

    @stevehipwell
    Collaborator

    This isn't stale, at a bare minimum the provider should allow different configuration for the different GH API versions. Maybe something similar to #849 (comment) but focusing on the API version.

    provider "github" {
      owner = "example-org"
      write_delay_ms    = 500 # default to 500ms
      v3_write_delay_ms = 500 # sleep for 500ms in between requests to the GitHub REST API
      v4_write_delay_ms = 50 # sleep for 50ms in between GraphQL requests
    }
  15. removed
    Status: Stale
    on Oct 22, 2024
  16. github-actions commented on Jul 19, 2025

    @github-actions

    👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

  17. added
    Status: Stale
    on Jul 19, 2025
  18. mogopz commented on Jul 19, 2025

    @mogopz

    This isn't stale, definitely still needed.

  19. removed
    Status: Stale
    on Jul 20, 2025
  20. moved this from Backlog to On Deck in Terraform Provideron Oct 14, 2025
  21. moved this from On Deck to In Progress in Terraform Provideron May 26, 2026
  22. moved this from In Progress to Done in Terraform Provideron Jun 4, 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

    ProviderStatus: Needs infoType: Bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions