排查常见问题
如果您遇到任何问题,请参阅以下部分以寻求帮助。
Fleet Engine 中丢失状态
使用 Fleet Engine 时,请在设计实现时预料到失败情况。例如,如果您向车队引擎发出更新车辆的请求,它可能会响应一个错误,指明车辆不存在。然后,您的实现应在新状态下重新创建车辆。
在极少数情况下,Fleet Engine 可能会发生灾难性故障,届时您可能需要重新创建大多数或所有车辆和任务。由于系统会进行配额检查以避免拒绝服务 (DOS) 攻击,因此如果创建速率过高,部分请求可能会再次因配额问题而失败。在这种情况下,请使用退避策略来减慢重新创建速率。
重试
请确保您的系统针对对 Fleet Engine 的请求实现了重试,因为这些请求可能会偶尔失败。Fleet Engine 客户端库默认会发出重试。
驾驶员应用中丢失状态
如果驱动程序应用发生崩溃,该应用必须在驱动程序 SDK 中重新创建当前状态。应用应尝试重新创建任务,以确保它们存在并恢复其当前状态。该应用还应重新创建并显式设置 Driver SDK 的停靠点列表。
注意:除了指示实体是否已存在于数据库中以及存在时间的错误之外,这些恢复必须自主完成,而不能依赖于来自车队引擎的信息。如果实体确实已存在,则可以忽略该错误,并使用实体的 ID 更新实体。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-25。
[null,null,["最后更新时间 (UTC):2025-02-25。"],[[["Fleet Engine implementations should be designed to handle failures and potential data loss by recreating vehicles and tasks when necessary."],["In case of Fleet Engine failures, use a backoff strategy to manage the recreation rate and avoid quota issues."],["Implement retries for Fleet Engine requests to address occasional failures, leveraging client library defaults or custom mechanisms."],["Driver apps should autonomously restore state after crashes by recreating tasks and stops within the Driver SDK, relying on error handling for existing entities."]]],["Implement error handling for Fleet Engine failures, such as vehicle non-existence, by recreating entities. In catastrophic failures, recreate vehicles and tasks, using a backoff strategy if quota issues arise. Implement request retries, as provided by Fleet Engine client libraries. If the driver app crashes, autonomously recreate tasks and stop lists within the Driver SDK, relying only on Fleet Engine errors to determine if entities already exist for update purposes.\n"]]