Khắc phục các sự cố thường gặp
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Hãy xem các phần sau đây để được trợ giúp nếu bạn gặp phải vấn đề.
Trạng thái bị mất trong Fleet Engine
Khi làm việc với Fleet Engine, hãy thiết kế quá trình triển khai để dự đoán các lỗi. Ví dụ: nếu bạn gửi yêu cầu đến Fleet Engine để cập nhật một chiếc xe, thì Fleet Engine có thể phản hồi bằng một lỗi cho biết rằng chiếc xe đó không tồn tại. Sau đó, quá trình triển khai của bạn sẽ tạo lại xe ở trạng thái mới.
Trong trường hợp cực kỳ hiếm gặp là Fleet Engine gặp lỗi nghiêm trọng, bạn có thể cần phải tạo lại hầu hết hoặc tất cả các xe và nhiệm vụ. Nếu tốc độ tạo quá cao, một số yêu cầu có thể không thành công do vấn đề về hạn mức vì các quy trình kiểm tra hạn mức được áp dụng để tránh các cuộc tấn công từ chối dịch vụ (DOS). Trong trường hợp này, hãy giảm tốc độ tạo lại bằng cách sử dụng chiến lược thời gian đợi cho các lần thử lại.
Thử lại
Đảm bảo hệ thống của bạn triển khai các lần thử lại cho các yêu cầu đến Fleet Engine vì đôi khi các yêu cầu này có thể không thành công. Theo mặc định, thư viện ứng dụng Fleet Engine sẽ thử lại.
Mất trạng thái trong ứng dụng dành cho tài xế
Nếu ứng dụng dành cho tài xế gặp sự cố, ứng dụng phải tạo lại trạng thái hiện tại trong Driver SDK. Ứng dụng nên cố gắng tạo lại các tác vụ để đảm bảo rằng các tác vụ đó tồn tại và khôi phục trạng thái hiện tại của chúng. Ứng dụng cũng nên tạo lại và đặt danh sách các điểm dừng một cách rõ ràng cho Driver SDK.
Lưu ý: Bạn phải tự thực hiện các thao tác khôi phục này mà không dựa vào thông tin từ Fleet Engine, ngoài các lỗi cho biết liệu một thực thể đã tồn tại trong cơ sở dữ liệu hay chưa và thời điểm nào. Nếu một thực thể đã tồn tại, thì lỗi đó có thể được hấp thụ và thực thể có thể được cập nhật bằng mã nhận dạng của thực thể.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-09-05 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-09-05 UTC."],[[["\u003cp\u003eFleet Engine implementations should be designed to handle failures and potential data loss by recreating vehicles and tasks when necessary.\u003c/p\u003e\n"],["\u003cp\u003eIn case of Fleet Engine failures, use a backoff strategy to manage the recreation rate and avoid quota issues.\u003c/p\u003e\n"],["\u003cp\u003eImplement retries for Fleet Engine requests to address occasional failures, leveraging client library defaults or custom mechanisms.\u003c/p\u003e\n"],["\u003cp\u003eDriver apps should autonomously restore state after crashes by recreating tasks and stops within the Driver SDK, relying on error handling for existing entities.\u003c/p\u003e\n"]]],["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"],null,["# Troubleshoot common issues\n\nCheck the following sections for help if you experience any issues.\n\nLost state in Fleet Engine\n--------------------------\n\nWhen working with Fleet Engine, design your implementation to anticipate\nfailures. For example, if you issue a request to Fleet Engine to update a\nvehicle, it might respond with an error indicating that the vehicle does not\nexist. Your implementation should then recreate the vehicle in the new state.\n\nIn the extremely unlikely scenario of a catastrophic failure of Fleet Engine,\nyou may need to recreate most or all vehicles and tasks. If the creation rate\nbecomes too high, some requests may fail again due to quota issues since quota\nchecks are in place to avoid denial of service (DOS) attacks. In this case, slow\ndown the recreation rate using a backoff strategy for reattempts.\n\n### Retries\n\nBe sure your system implements retries for requests to Fleet Engine since they\nmight fail occasionally. Fleet Engine client libraries issue retries by default.\n\nLost state in the driver app\n----------------------------\n\nIf the driver app crashes, the app must recreate the current state within the\nDriver SDK. The app should attempt to recreate tasks to ensure that they exist\nand to restore their current states. The app should also recreate and explicitly\nset the list of stops for the Driver SDK.\n\n**Note**: These restorations must be done autonomously without relying on\ninformation from Fleet Engine, other than errors indicating if and when an\nentity already exists in the database. If an entity does already exist, then\nthat error can be absorbed and the entity can be updated using its ID."]]