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

[24.0] Close install model session when request ends #18629

Merged

Conversation

mvdbeek
Copy link
Member

@mvdbeek mvdbeek commented Jul 31, 2024

This is probably the more general fix for
#18627.

@kysrpex could you test this without the explicit session management you suggested in #18627 ?

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@mvdbeek mvdbeek added kind/bug area/API area/database Galaxy's database or data access layer labels Jul 31, 2024
@github-actions github-actions bot added this to the 24.1 milestone Jul 31, 2024
@mvdbeek mvdbeek force-pushed the fix_install_model_session_scope branch from 101b3ef to ecd7bbb Compare July 31, 2024 19:45
This is probably the more general fix for
galaxyproject#18627.
@mvdbeek mvdbeek force-pushed the fix_install_model_session_scope branch from ecd7bbb to d83b56b Compare July 31, 2024 20:26
@bgruening
Copy link
Member

from typing import Optional

Is missing in lib/galaxy/webapps/galaxy/buildapp.py but github does not let me add suggestions into the right spot.

@mvdbeek mvdbeek force-pushed the fix_install_model_session_scope branch from a126f10 to 20cedf7 Compare August 1, 2024 13:37
@kysrpex
Copy link
Contributor

kysrpex commented Aug 1, 2024

Thanks @mvdbeek. I am testing this with the code snippet from #18627 and so far I am not getting any HTTP 500. I'll let the tool installation CI run overnight just to be sure though.

Tomorrow I share the results with you and if it worked we can merge. Alternatively, you may also check it yourself here (the link won't work until the the CI ends). Once the job is finished, search for "GET: error 500: b'Internal Server Error'" within the file.

@kysrpex
Copy link
Contributor

kysrpex commented Aug 2, 2024

GET: error 500: b'Internal Server Error'

It showed up many times on the CI logs :(

@mvdbeek
Copy link
Member Author

mvdbeek commented Aug 2, 2024

What did you test where and which commit ?

@kysrpex
Copy link
Contributor

kysrpex commented Aug 2, 2024

What did you test where and which commit ?

I tested a126f10 (added from typing import Optional manually) on the useGalaxy.eu server. This is the tool installation CI log showing the HTTP 500 errors when running a126f10.

@mvdbeek
Copy link
Member Author

mvdbeek commented Aug 2, 2024

Do you have the logs somewhere ? The tool install log doesn't help. I'm not seeing anything suspicious in sentry.

@mvdbeek
Copy link
Member Author

mvdbeek commented Aug 2, 2024

I think I see the problem though, if we have FastAPI routes that don't depend on trans or app we're never applying the session scope logic.

@kysrpex
Copy link
Contributor

kysrpex commented Aug 2, 2024

When the issue pops up it does it in this Sentry issue. The events from the last 24 hours

image

correspond to the last tool install run. Most likely many PendingRollbackError are linked to this other error.

I cannot get you the gunicorn logs from yesterday because the logs have already rotated (too many entries per second). To get them I have to set up some machinery to dump them somewhere else and trigger the failure again (which I may do). I assume you'd want to see the full wall of text during the whole duration of the tool installation CI run right?

@mvdbeek
Copy link
Member Author

mvdbeek commented Aug 2, 2024

It's ok, I think I see the problem, see #18629 (comment)

@kysrpex
Copy link
Contributor

kysrpex commented Aug 2, 2024

I think I see the problem though, if we have FastAPI routes that don't depend on trans or app we're never applying the session scope logic.

Yes, in the stacktrace from the Sentry issue I linked you can see the request goes through FastAPI (this line).

@kysrpex
Copy link
Contributor

kysrpex commented Aug 2, 2024

@mvdbeek Trying d20b333 out (link to CI log). As usual I let you know once it finishes.

@kysrpex
Copy link
Contributor

kysrpex commented Aug 5, 2024

It works!! 🚀 🚀

@bgruening
Copy link
Member

Are the failing startup tests relevant?

@mvdbeek
Copy link
Member Author

mvdbeek commented Aug 5, 2024

No, it's 3.12 which isn't compatible with the pydantic version we install, all 24.0 PRs have that problem.

@mvdbeek mvdbeek merged commit f6c8c63 into galaxyproject:release_24.0 Aug 5, 2024
43 of 49 checks passed
@galaxyproject-sentryintegration
Copy link

galaxyproject-sentryintegration bot commented Aug 5, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly /api/entry_points View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/API area/database Galaxy's database or data access layer kind/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants