PR

【6/5】ゲームマラソンAPI関係 #2828

kouho opened this at 2023-06-05T14:31:06; closed

Description

opened by kouho at 2023-06-05T14:31:06; updated 2023-06-05T14:53:09

概要

6/4 22:00~6/4 23:30に特にゲームが重いとの問い合わせが多かった。
yamada_api_error.txt と error2.txt を見る限り以下の二つが原因の可能性がある

1. マラソンapiカウント記録時のロック周りのエラー

2. ヤマダゲームマラソンapi実行時のsyntaxエラー
ヤマダゲーム側起因
詳細はヤマダゲームに確認中。

改善対応

  • 1の問題への対応としてマラソンAPIはカウントしないようにする
  • マラソンクリア時にはpostしないようにしてみる(処理は増えるがpostが増えることを防止するのを優先)

エラー例

 :sqlerror:1:Lock wait timeout exceeded; try restarting transaction:YamadaAPI.class(656)/YamadaAPI.class(620)/YamadaAPI.class(61
0)/YamadaAPI.class(436)/YamadaPlatformService.class(184)/Yamada_game_marathon(160)/SubFunc(21327)/SubFunc_valhalla(796)/SubFunc_
valhalla(202)/valhalla_default(56)/ajax(558):
                        INSERT INTO
                                `log_yamada_api_count`
                        (
                                `date`,
                                `type`,
                                `count`
                        ) values (
                                2306042230,
                                2,
                                1
                        )
                        ON DUPLICATE KEY UPDATE
                                `count` = `count` + 1
 Syntax error|<!doctype html><html lang="ja"><head><title>HTTPステータス 500 - Internal Server Error< ...

状況メモ

ヤマダゲームのマラソンAPIのエラーでSyntaxエラーが出ている
  ヤマダゲーム側に共有して確認依頼中。

DB側でロック待ち時間が増え出した期間
   6/4 22:00~6/4 23:30

ゲーム側ではapiのカウント(yamada_api_count)でロックエラーが出ている。

3秒以上アクセスに時間がかかった回数がかなり多い
  (件数は取得中にタイムアウトするため正確な回数は未取得)

サーバー負荷
  ロードアベレージは最大4を超えているがそもそもDBは8コアなので問題はない。
  DB側のスケールアップで対処が必要なわけではなく、アプリ側での対応が必要。

補填と再現可能性について
  原因が絞り込めていないため再現の可能性はある。
  再現の可能性があるため補填をしてもその場しのぎで意味がない状態。
kouho add_label at 2023-06-05T14:31:09: レビュー待ち

Comment

#27923 by kouho at 2023-06-05T14:34:17; updated 2023-06-05T14:34:17

@wada
レビューお願いいたします

Comment

#27924 by wada at 2023-06-05T14:51:32; updated 2023-06-05T14:51:32

@kouho
確認OKです。

kouho merge at 2023-06-05T14:53:09: 【6/5】ゲームマラソンAPI関係
kouho close at 2023-06-05T14:53:09: Close

Commit range

base276bb91483455a071944f667d288932af3d80d9c
headefb52bdd31aed986884f865cc044933190e3b363
base branchjolly/jr-web:master
head branchjolly/jr-web:check_complete_marathon

View commits

Commit details are loaded from Git when a dynamic archive server is running, or can be embedded with --include-commits.
Files changed2 filesView patch
statusfile
modifiedlib/class/platform/yamada/YamadaAPI.class.php
modifiedlib/models/Yamada_game_marathon.php
Patch body is stored as a separate file to keep this page lightweight.