Skip to content
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

Allow adding a grpc.service_config without having to specify each service name. #2549

Closed
martyphee opened this issue Aug 18, 2023 · 1 comment

Comments

@martyphee
Copy link

martyphee commented Aug 18, 2023

Is your feature request related to a problem? Please describe.

When specifying grpc.service_config we have to specify each service in the name configuration or an error is thrown.

Example

"grpc.service_config": JSON.stringify({
    methodConfig: [
      {
        name: [{ service: "org.grpc.service.v1.PolicyManagementService" }],
        timeout: {
          seconds: 5,
          nanos: 0
        }
      }
    ]
  })

Describe the solution you'd like

Could we make the name optional like [{}]? We do this in our Python and Scala services and it works as expected.

Describe alternatives you've considered

An alternative might be a wildcard like org.grpc.*

Additional context

Might just be the project I'm using this on but it needs to interact with a number of services and I would need to list them all. It's not a huge deal but it would be nice if it worked like other gRPC libraries.

Here is a sample from on of our Python applications which is in production.

import json

import grpc
from grpc.aio import insecure_channel, secure_channel

from app.configuration import configuration

OPTIONS = [
    ("grpc.enable_retries", 1),
    (
        "grpc.service_config",
        json.dumps(
            {
                "methodConfig": [
                    {
                        "name": [{}],
                        "retryPolicy": {
                            "maxAttempts": 5,
                            "initialBackoff": "0.1s",
                            "maxBackoff": "1s",
                            "backoffMultiplier": 2,
                            "retryableStatusCodes": ["UNAVAILABLE"],
                        },
                    }
                ]
            },
        ),
    ),
]
@murgatroid99
Copy link
Member

This has been fixed in version 1.9.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants