回答状況の更新が失敗するケースがあるので修正しましょう
Summary / 概要
- 不定期で回答状況の更新が失敗 + サーバが一時的にダウンしている時間帯がある
Steps to reproduce / 再現方法
- adminによる問題(集)の追加・更新と一般ユーザの回答更新のリクエストが同時に発生すると、20〜30分程度不安定に
- yyy
- zzz
environments
-
Desktop (please complete the following information):
OS: [e.g. Mac, Windows11, Linux] Browser [e.g. Chrome, Safari, Edge, Firefox] Version [e.g. 117.0.05938.44]
-
Smartphone (please complete the following information):
Device: [e.g. iPhone15, Android13] OS: [e.g. iOS16.5, Android 13] Browser [e.g. Chrome, Safari] Version [e.g. 16.5]
-
Tablet (please complete the following information):
OS: [e.g. Android OS, Chrome OS, Windows11, iPad OS] Browser [e.g. Chrome, Safari, Edge, Firefox] Version [e.g. 16.5]
Expected behavior / 期待される挙動
- ユーザの回答状況が更新される
- 管理者による問題の更新・追加,問題集の作成・更新ができる
Actual behavior / 実際の挙動
- 回答状況の更新が失敗するケースがある
- 20~30分程度上記の状態が続くが,頻度はそこまで高くない
- ユーザ数の増加により,同様の事例が増えることは予想される
Screenshots
- If applicable, add screenshots to help explain your problem.
Other notes / その他
- Add any other context about the problem here.
- Will you try to create a pull request?
- yes / no
対処方法(案)
- サーバのログを確認
- トランザクション処理を実装
- 問題の作成・更新・削除
- 問題集の作成・更新・削除
- キャッシュの導入
- リバースプロキシ?の導入 / 設定の見直し
https://www.prisma.io/docs/orm/reference/error-reference
https://www.prisma.io/docs/accelerate/caching
Failed to update task result: PrismaClientKnownRequestError:
Invalid `prisma.taskAnswer.upsert()` invocation:
Unique constraint failed on the fields: (`id`)
at Mn.handleRequestError ...
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 5)
PrismaClientKnownRequestError:
Invalid `prisma.session.findUnique()` invocation:
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 5)
Can't reach database server at `...`
Please make sure your database server is running at `...`.
code: 'P1001',