Conversation
… (B19) The decision to complete a transform request was made outside the locked record_file_complete transaction and without any status check, so a request still in lookup could be completed as soon as the files published so far finished, a late callback could flip a canceled request to complete, and two concurrent final callbacks could both complete it. The completion decision now happens inside the same locked transaction and only for running requests, and fileset_complete completes and shuts down a request whose files were all transformed before its lookup finished. cancel_transform now shuts the job down for any non terminal status, so cancelling a pending_lookup request no longer leaks its Deployment, HPA and ConfigMap until the reaper runs. Refs ssl-hep#1539 Assisted-by: claude-code:claude-opus-5
Editing a profile updated the user record but left the old email in the session, so a changed email made /profile redirect back to create-profile and made /api-token fail. The session is now refreshed from the saved user. Refs ssl-hep#1539 Assisted-by: claude-code:claude-opus-5
An unknown code generator name, a custom docker image that does not match an allowed prefix, and a missing transformer image all fell through to the generic exception handler and were reported as 500 server errors. They now return 400 with the underlying message. This also removes a leftover debug print and the stale maximum length hint on the title argument. Refs ssl-hep#1539 Assisted-by: claude-code:claude-opus-5
add_files read and incremented the file count on the transform request without locking the row, so concurrent PUTs from the DID finder could lose increments and leave files_remaining permanently above zero. The request rows are now selected with with_for_update() before the counter is updated. Refs ssl-hep#1539 Assisted-by: claude-code:claude-opus-5
TransformRequest.did was String(512) while Dataset.name is String(1024), so a DID longer than 512 characters was inserted into the datasets table and then failed on the requests table after the lookup had already been submitted. The column is widened to 1024 with an accompanying Alembic migration. Refs ssl-hep#1539 Assisted-by: claude-code:claude-opus-5
The dashboard raised a KeyError on session["user_id"] when authentication is disabled, create_profile re-rendered the form after the user had already been saved when the Slack webhook failed so a resubmit hit the unique index, and auth_callback concatenated a query parameter that may be absent. The dashboard now reads the user id defensively and drops a no-op filter, create_profile redirects to the profile and only logs the webhook error, and auth_callback tolerates a missing error description. Refs ssl-hep#1539 Assisted-by: claude-code:claude-opus-5
ariostas
force-pushed
the
fix/app-request-lifecycle
branch
from
September 9, 2026 13:56
f24b406 to
5d6c39f
Compare
14 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
This PR tightens the transform request lifecycle in the Flask app so a request only reaches a terminal state when it really is finished and concurrent callbacks from the DID finder and the transformers cannot corrupt the file counters. It also stops the submit endpoint from reporting client errors as server errors, widens the DID column to match the datasets table, and fixes a handful of web portal bugs around session state and redirects.
How to review. Each finding is one commit; the Commits tab shows them in severity order. Each entry below links to its commit; tick approve or reject under it. To ask for a change instead, leave a review comment on the commit. Rejected commits will be dropped from the branch and this list will be updated to match.
f9e1513· Decide completion inside the lockedrecord_file_completetransaction and only forrunningrequests, complete and shut down requests whose files finished before lookup did, and shut down any non terminal job on cancelf8e3e6a· Refresh the session from the saved user after editing a profile so a changed email no longer breaks/profileand/api-tokene05e9c7· Return 400 instead of 500 for an unknown codegen, a disallowed custom docker image or a missing transformer image, and drop a debugprintand a stale help string82d3461· Lock the request rows withwith_for_update()inadd_filesso concurrent PUTs cannot lose file count incrementsc5c7ce3· WidenTransformRequest.didfrom 512 to 1024 characters to matchDataset.name, with an Alembic migration5d6c39f· Read the dashboard user id defensively, redirect to the profile after saving even when the Slack webhook fails, and tolerate a missingerror_descriptionin the auth callbackFollow-ups noticed, out of scope
v1_8_4); whichever of the two merges second needs itsdown_revisionre-pointed at the other._validate_custom_docker_imagecan also fail because of a server side misconfiguration, which now surfaces to the client as a 400 rather than a 500.submit.py, so a failed submit orphans a bucket.Part of #1539.