Brijesh-Thakkar commented on issue #19713: URL: https://github.com/apache/beam/issues/19713#issuecomment-6526619339
I reproduced this on current master with a unit test: ProtoCoder.of((Class) Message.class).decode(...) fails with NoSuchMethodException: com.google.protobuf.Message.getDefaultInstance() from ProtoCoder.getParser. T extends Message erases to the Message interface, so the coder has no concrete type to get a parser from. #34194 and #37005 tried an instantiation fallback, but that can't work for an interface, which is why neither had a test failing before the change. Proposed direction: fail fast at pipeline construction with an actionable error (use the concrete class, DynamicProtoCoder, or setCoder) instead of failing on workers at decode time, with a test that fails today. Carrying the class name in the encoding would actually make it work, but it breaks wire compatibility. @Abacn @robertwb since you reviewed the earlier attempts: does fail-fast sound right, or would you prefer another approach? -- 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]
