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

KAN 75 fix(database): fix db persistence timeout and connection lost errors #31

Merged
merged 4 commits into from
Oct 6, 2024

Conversation

FlyingPufferFish
Copy link
Collaborator

@FlyingPufferFish FlyingPufferFish commented Oct 6, 2024

Testing this PR

Testing large input file:

  • run frontend and backend
  • upload file of 11k students
  • go through timetable generation process
  • verify that an output is displayed within 10 seconds

Testing timefold solving timeout limit:

  • set quarkus.timefold.solver.termination.spent-limit=60s in application.properties
  • run frontend and backend
  • upload any test input file
  • verify that no errors are thrown and successfully generates timetable after the 60s

Commits Overview

Commit 1: extend db transaction timeout limit to 320s

  • This prevents server timeout if we choose to let the TimeFold algorithm run for longer than 60s, because timeout limit defaults to 60s

Commit 2: add logging metrics and enable logfiles

  • logged info will appear in the backend terminal once Quarkus app is running
  • The same info will be logged to a .log file inside a folder named logs, which lives inside the backend directory

Commit 3: remove storage of students in Unit class to speed up database Timetable object persistence

  • The storage of students is the most resource-intensive operation, which caused lost-connection errors when persisting because it was taking so long
  • Our current codebase does not retrieve the Student objects after timetables are generated, therefore, they are no longer stored in the database

@FlyingPufferFish FlyingPufferFish force-pushed the kan-75/fix-persist-errors branch from a7c2d61 to d86a3db Compare October 6, 2024 00:55
@hotungkhanh hotungkhanh self-requested a review October 6, 2024 01:33
@FlyingPufferFish FlyingPufferFish changed the title KAN 75 fix(database): fix persist timeout and connection lost errors KAN 75 fix(database): fix db persistence timeout and connection lost errors Oct 6, 2024
@FlyingPufferFish FlyingPufferFish merged commit 6250939 into develop Oct 6, 2024
@FlyingPufferFish FlyingPufferFish deleted the kan-75/fix-persist-errors branch October 6, 2024 05:54
dh-giang-vu pushed a commit that referenced this pull request Oct 23, 2024
KAN 75 fix(database): fix persist timeout and connection lost errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants