Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

回答状況の更新が失敗するケースがあるので修正しましょう #1310

Open
KATO-Hiro opened this issue Sep 25, 2024 · 5 comments
Labels
bug Something isn't working priority high

Comments

@KATO-Hiro
Copy link
Collaborator

KATO-Hiro commented Sep 25, 2024

Summary / 概要

  • 不定期で回答状況の更新が失敗 + サーバが一時的にダウンしている時間帯がある

Steps to reproduce / 再現方法

  1. adminによる問題(集)の追加・更新と一般ユーザの回答更新のリクエストが同時に発生すると、20〜30分程度不安定に
  2. yyy
  3. 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
@KATO-Hiro KATO-Hiro added bug Something isn't working priority high labels Sep 25, 2024
@KATO-Hiro KATO-Hiro changed the title 回答状況の更新が失敗する頻度が上がっているので修正しましょう 回答状況の更新が失敗するケースがあるので修正しましょう Sep 25, 2024
@KATO-Hiro
Copy link
Collaborator Author

対処方法(案)

  • サーバのログを確認
  • トランザクション処理を実装
    • 問題の作成・更新・削除
    • 問題集の作成・更新・削除
  • キャッシュの導入
  • リバースプロキシ?の導入 / 設定の見直し

@KATO-Hiro
Copy link
Collaborator Author

@KATO-Hiro
Copy link
Collaborator Author

@KATO-Hiro
Copy link
Collaborator Author

Failed to update task result:  PrismaClientKnownRequestError: 
Invalid `prisma.taskAnswer.upsert()` invocation:


Unique constraint failed on the fields: (`id`)
    at Mn.handleRequestError ...

@KATO-Hiro
Copy link
Collaborator Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority high
Projects
None yet
Development

No branches or pull requests

1 participant