-
Notifications
You must be signed in to change notification settings - Fork 11
Don't build symbols we already have in the state #59
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
Open
mjheilmann
wants to merge
1
commit into
main
Choose a base branch
from
57-fix-infinite-loop-when-messages-in-the-same-proto-file-reference-each-other
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
syntax = "proto3"; | ||
|
||
package recursive_message; | ||
|
||
service Service { | ||
rpc call (Request) returns (Reply) {} | ||
} | ||
|
||
message Request { | ||
Reply reply = 1; | ||
} | ||
|
||
message Reply { | ||
Request request = 1; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
defmodule RecursiveMessage.Request do | ||
@moduledoc false | ||
|
||
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3 | ||
|
||
def descriptor do | ||
# credo:disable-for-next-line | ||
%Google.Protobuf.DescriptorProto{ | ||
name: "Request", | ||
field: [ | ||
%Google.Protobuf.FieldDescriptorProto{ | ||
name: "reply", | ||
extendee: nil, | ||
number: 1, | ||
label: :LABEL_OPTIONAL, | ||
type: :TYPE_MESSAGE, | ||
type_name: ".recursive_message.Reply", | ||
default_value: nil, | ||
options: nil, | ||
oneof_index: nil, | ||
json_name: "reply", | ||
proto3_optional: nil, | ||
__unknown_fields__: [] | ||
} | ||
], | ||
nested_type: [], | ||
enum_type: [], | ||
extension_range: [], | ||
extension: [], | ||
options: nil, | ||
oneof_decl: [], | ||
reserved_range: [], | ||
reserved_name: [], | ||
__unknown_fields__: [] | ||
} | ||
end | ||
|
||
field :reply, 1, type: RecursiveMessage.Reply | ||
end | ||
|
||
defmodule RecursiveMessage.Reply do | ||
@moduledoc false | ||
|
||
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3 | ||
|
||
def descriptor do | ||
# credo:disable-for-next-line | ||
%Google.Protobuf.DescriptorProto{ | ||
name: "Reply", | ||
field: [ | ||
%Google.Protobuf.FieldDescriptorProto{ | ||
name: "request", | ||
extendee: nil, | ||
number: 1, | ||
label: :LABEL_OPTIONAL, | ||
type: :TYPE_MESSAGE, | ||
type_name: ".recursive_message.Request", | ||
default_value: nil, | ||
options: nil, | ||
oneof_index: nil, | ||
json_name: "request", | ||
proto3_optional: nil, | ||
__unknown_fields__: [] | ||
} | ||
], | ||
nested_type: [], | ||
enum_type: [], | ||
extension_range: [], | ||
extension: [], | ||
options: nil, | ||
oneof_decl: [], | ||
reserved_range: [], | ||
reserved_name: [], | ||
__unknown_fields__: [] | ||
} | ||
end | ||
|
||
field :request, 1, type: RecursiveMessage.Request | ||
end | ||
|
||
defmodule RecursiveMessage.Service.Service do | ||
@moduledoc false | ||
|
||
use GRPC.Service, name: "recursive_message.Service", protoc_gen_elixir_version: "0.14.1" | ||
|
||
def descriptor do | ||
# credo:disable-for-next-line | ||
%Google.Protobuf.ServiceDescriptorProto{ | ||
name: "Service", | ||
method: [ | ||
%Google.Protobuf.MethodDescriptorProto{ | ||
name: "call", | ||
input_type: ".recursive_message.Request", | ||
output_type: ".recursive_message.Reply", | ||
options: %Google.Protobuf.MethodOptions{ | ||
deprecated: false, | ||
idempotency_level: :IDEMPOTENCY_UNKNOWN, | ||
features: nil, | ||
uninterpreted_option: [], | ||
__pb_extensions__: %{}, | ||
__unknown_fields__: [] | ||
}, | ||
client_streaming: false, | ||
server_streaming: false, | ||
__unknown_fields__: [] | ||
} | ||
], | ||
options: nil, | ||
__unknown_fields__: [] | ||
} | ||
end | ||
|
||
rpc :call, RecursiveMessage.Request, RecursiveMessage.Reply | ||
end | ||
|
||
defmodule RecursiveMessage.Service.Stub do | ||
@moduledoc false | ||
|
||
use GRPC.Stub, service: RecursiveMessage.Service.Service | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix works for the server side but not the client side. This approach still generates separate files (recursive_message.Request.proto, recursive_message.Reply.proto), even though both messages live in the same source proto. Reflection clients (grpcurl, the Go reflection client, etc.) follow the dependency list, so they’ll bounce back and forth between those synthetic files forever and never resolve the request. In practice that means a FileByFilename loop and eventually a stack overflow—the exact failure we’re trying to eliminate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the clients are relying on protocol not supporting circular dependencies, so they don't cover it. Interesting