Go 模块文件版本问题缺少最新更改
我遇到过这样的情况:我使用 3 个工件以不同的方式构建和部署。
- 工件 1 有我的最新更改,
- 工件 2 和 3 将工件 1 下载为模块。
其中:
- 工件 2 必须对工件 3 进行 GRPC 调用才能访问数据,
- 与工件 2 相比,工件 3 的工件 1 版本较旧。
现在:
- 工件 2 在对工件 3 进行 GRPC 调用之前针对工件 1 进行验证,
- 工件 3在完成交易之前,也会针对工件 1 进行类似的验证。
问题:由于版本较旧,工件 2 中的验证已通过,但工件 3 中的验证失败。
当前代码抛出异常,尝试最多次数。次。
我可以考虑保持工件同步,但是我无法确定它会保持不变。
如何处理这些不兼容性,以免所有请求都失败或产生意外/不一致的结果?
I have a situation where i work with 3 artifacts build and deployed differently.
- Artifact 1 has my latest changes,
- Artifact 2 and 3 download artifact 1 as a module.
With:
- Artifact 2 has to make a GRPC call to Artifact 3 to access data,
- Artifact 3 has an older version of artifact 1 compared to artifact 2.
Now:
- Artifact 2 validates against artifact 1 before making the GRPC call to artifact 3,
- artifact 3 also makes similar validation against artifact 1 before it completes the transaction.
Problem: Validation in artifact 2 passed but fails in artifact 3, because of older version.
Current code throw exception which is tried max no. of times.
I can think of keeping the artifacts in sync however there is no way i can be sure it is going to stay same.
What are the ways these kind of incompatibilities are dealt with so not all requests fail or produce unexpected/inconsistent results?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以:
在这两种选择中,这都是一个发行版您始终无法控制的问题:如何确保正确的版本部署在正确的位置?
这意味着实际的解决方案是确保向后兼容性,允许服务器返回旧版本的GRPC 消息。
You would either:
In both option, this is a distribution issue that you cannot always control: how to ensure the right version is deployed in the right place?
That means the actual solution is to ensure backward compatibility, allowing the server to return older versions of your GRPC message.