github-actions[bot] commented on code in PR #68785:
URL: https://github.com/apache/doris/pull/68785#discussion_r4228952630


##########
gensrc/AGENTS.md:
##########
@@ -0,0 +1,22 @@
+# AGENTS.md — gensrc (thrift / protobuf)
+
+Everything under `gensrc/thrift` and `gensrc/proto` is a wire format between 
FE, BE and the cloud services, FE↔FE and BE↔BE included during a rolling 
upgrade. The wire carries field ids, enum values and service method names, not 
field or enum names. A field that arrives on an id of the same wire type is 
read as that field, so same wire type is not enough: thrift container element 
types and proto integer width and signedness (int32, int64, uint32, bool, enum 
and sint* are all varints) must match too. A missing or mistyped `required` 
field fails the whole read. An enum value the receiver does not know is a raw 
integer in thrift C++ but unset, so the default, in thrift Java and proto2.

Review Comment:
   [P2] Check Thrift Java enum defaults after an unknown value. With Doris's 
Thrift 0.24.0 generator, `findByValue` returns null for an unknown integer and 
the reader assigns that null to the field. For example, a Java receiver of 
`TQueryOptions.query_type` loses its declared `SELECT` default; 
`isSetQueryType()` is false and `getQueryType()` returns null. The same default 
claim recurs in the rule below. Correct both statements and require checking 
the Java receiver's explicit null/absence handling before adding enum values.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to