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

Maximum recursion depth exceeded during google/bigtable/v2 generation #585

Closed
busunkim96 opened this issue Aug 31, 2020 · 2 comments
Closed
Assignees
Labels
conversion blocking A surface delta, bug, missing feature, or other issue that prevents API conversion priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@busunkim96
Copy link
Contributor

Tested with 0.32.1 and 0.32.3

Steps to reproduce:

Edit google/bigtable/v2/BUILD.bazel with these Python rules

##############################################################################
# Python
##############################################################################
# This library is using Python microgenerator.
# DO NOT OVERRIDE this Python section with autogenerated rules.
load(
    "@com_google_googleapis_imports//:imports.bzl",
    py_gapic_assembly_pkg = "py_gapic_assembly_pkg2",
    py_gapic_library = "py_gapic_library2",
)

py_gapic_library(
    name = "bigtable_py_gapic",
    srcs = [":bigtable_proto"],
)

# Open Source Packages
py_gapic_assembly_pkg(
    name = "bigtable-v2-py",
    deps = [
        ":bigtable_py_gapic",
    ],
)

Generate via bazel:

bazel build //google/bigtable/v2:bigtable-v2-py

Generation fails with the following stack trace (truncated for readability):

  File "/usr/local/google/home/busunkim/.cache/bazel/_bazel_busunkim/5f7ad274936c83fa5125630e373edd54/sandbox/linux-sandbox/2139/execroot/com_google_googleapis/bazel-out/host/bin/external/gapic_generator_python/gapic_plugin.runfiles/gapic_generator_python/gapic/utils/cache.py", line 39, in inner
    self._cached_values[fx.__name__] = fx(self)
  File "/usr/local/google/home/busunkim/.cache/bazel/_bazel_busunkim/5f7ad274936c83fa5125630e373edd54/sandbox/linux-sandbox/2139/execroot/com_google_googleapis/bazel-out/host/bin/external/gapic_generator_python/gapic_plugin.runfiles/gapic_generator_python/gapic/schema/wrappers.py", line 118, in mock_value
    answer = f'{self.type.ident}({sub.name}={sub.mock_value})'
  File "/usr/local/google/home/busunkim/.cache/bazel/_bazel_busunkim/5f7ad274936c83fa5125630e373edd54/sandbox/linux-sandbox/2139/execroot/com_google_googleapis/bazel-out/host/bin/external/gapic_generator_python/gapic_plugin.runfiles/gapic_generator_python/gapic/utils/cache.py", line 39, in inner
    self._cached_values[fx.__name__] = fx(self)
  File "/usr/local/google/home/busunkim/.cache/bazel/_bazel_busunkim/5f7ad274936c83fa5125630e373edd54/sandbox/linux-sandbox/2139/execroot/com_google_googleapis/bazel-out/host/bin/external/gapic_generator_python/gapic_plugin.runfiles/gapic_generator_python/gapic/schema/wrappers.py", line 118, in mock_value
    answer = f'{self.type.ident}({sub.name}={sub.mock_value})'
  File "/usr/local/google/home/busunkim/.cache/bazel/_bazel_busunkim/5f7ad274936c83fa5125630e373edd54/sandbox/linux-sandbox/2139/execroot/com_google_googleapis/bazel-out/host/bin/external/gapic_generator_python/gapic_plugin.runfiles/gapic_generator_python/gapic/utils/cache.py", line 39, in inner
    self._cached_values[fx.__name__] = fx(self)
  File "/usr/local/google/home/busunkim/.cache/bazel/_bazel_busunkim/5f7ad274936c83fa5125630e373edd54/sandbox/linux-sandbox/2139/execroot/com_google_googleapis/bazel-out/host/bin/external/gapic_generator_python/gapic_plugin.runfiles/gapic_generator_python/gapic/schema/wrappers.py", line 118, in mock_value
    answer = f'{self.type.ident}({sub.name}={sub.mock_value})'
  File "/usr/local/google/home/busunkim/.cache/bazel/_bazel_busunkim/5f7ad274936c83fa5125630e373edd54/sandbox/linux-sandbox/2139/execroot/com_google_googleapis/bazel-out/host/bin/external/gapic_generator_python/gapic_plugin.runfiles/gapic_generator_python/gapic/schema/metadata.py", line 79, in __str__
    if self.module_alias:
RecursionError: maximum recursion depth exceeded
--python_gapic_out: protoc-gen-python_gapic: Plugin failed with status code 1.
Target //google/bigtable/v2:bigtable-v2-py failed to build

CC @kolea2

@busunkim96 busunkim96 added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. conversion blocking A surface delta, bug, missing feature, or other issue that prevents API conversion labels Aug 31, 2020
@software-dov software-dov self-assigned this Sep 1, 2020
@software-dov
Copy link
Contributor

The rendering is getting caught on data.proto:RowFilter. This is a recursive message type via the 'filter' oneof with recurrant case in 'chain', 'interleave', and 'condition' variants and nested types.

The solution is to have a hard recursion cap in the rendering itself. Fix is incoming.

@software-dov
Copy link
Contributor

Fixed by #587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conversion blocking A surface delta, bug, missing feature, or other issue that prevents API conversion priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants