PHP 5 はサポートが終了しており、2026 年 1 月 31 日に
非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、PHP 5 アプリケーションをデプロイできなくなります。既存の PHP 5 アプリケーションは、
非推奨になる日付以降も引き続き実行され、トラフィックを受信します。
サポートされている最新バージョンの PHP に移行することをおすすめします。
失敗した push タスクの再試行
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
タスクキューを介して処理される push タスクは、さまざまな理由で失敗することがあります。ハンドラがタスクの実行に失敗した場合(200~299 以外の HTTP ステータス コードが返された場合)、App Engine は成功するまでタスクを再試行します。
デフォルトでは、アプリケーションが大量のリクエストで過負荷状態になるのを避けるため、再試行速度が徐々に低下し、タスクが成功するまで 1 時間に最大 1 回繰り返すスケジュールに設定されます。
タスクの再試行
再試行パラメータ要素を queue.yaml
に追加することにより、タスク再試行の独自のスキームをカスタマイズできます。この設定では、特定のキューでの失敗したタスクの最大再試行回数を指定できます。再試行の制限時間を設定したり、再試行の間隔を制御したりすることもできます。
次の例に、さまざまな再試行のシナリオを示します。
fooqueue
では、タスクは最初の試行から 2 日間を期限とし、7 回を上限として再試行されます。両方の上限に達すると、タスクは完全に失敗し、再試行されなくなります。
barqueue
では、App Engine は、再試行の回数に応じて間隔を長くしながらタスクを再試行し、最大バックオフに達すると、最大間隔で無限に再試行します(リクエストの間隔は 10 秒、20 秒、30 秒、...、190 秒、200 秒、200 秒、... となります)。
bazqueue
では、再試行間隔は 10 秒から開始し、3 回 2 倍ずつ間隔を長くします。その後は直線的に間隔が広げられます。最終的には、最大間隔で無限に再試行します(リクエストの間隔は 10 秒、20 秒、40 秒、80 秒、160 秒、240 秒、300 秒、300 秒、... となります)。
queue:
- name: fooqueue
rate: 1/s
retry_parameters:
task_retry_limit: 7
task_age_limit: 2d
- name: barqueue
rate: 1/s
retry_parameters:
min_backoff_seconds: 10
max_backoff_seconds: 200
max_doublings: 0
- name: bazqueue
rate: 1/s
retry_parameters:
min_backoff_seconds: 10
max_backoff_seconds: 300
max_doublings: 3
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-19 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-19 UTC。"],[[["Push tasks in App Engine are automatically retried upon failure, with the system gradually reducing the retry rate to prevent application overload, up to a maximum of once per hour."],["Custom retry schemes can be configured using the `retry_parameters` element in `queue.yaml`, allowing control over the maximum number of retries, the retry time limit, and the interval between retries."],["Different retry strategies can be implemented, including fixed retry limits, linearly increasing retry intervals, and exponentially increasing intervals with a cap, as demonstrated by the `fooqueue`, `barqueue`, and `bazqueue` examples."],["This retry API is compatible with first-generation runtimes and can be used during upgrades to second-generation runtimes, with a separate migration guide for PHP 7/8 runtimes."]]],[]]