Skip to content

A review click can wait on the aligner with no bound #798

Description

@WaylandYang

From the review of #792.

Deciding a kind word from the review page now writes the binding and its entity projection in one transaction, which is right: it is what stops an older agent run from applying its class after a person has decided. The transaction holds the type_bindings row from decide to commit, and inside it updates every entity in the base whose normalized specific_type matches that word. For a common word that is most of the base.

decide_alignment_kind_word is a synchronous HTTP handler, and the main pool sets no lock_timeout or statement_timeout — only query_engine/postgres.rs sets one, and that is for external databases. So a person's click can wait behind the aligner's entity update with no bound, and the only thing they see is a request that does not come back.

What it should do instead: set a lock_timeout on that handler's transaction and answer 409 when it expires, with a message saying the aligner is working on that word and to try again. A person who is told to wait a moment is in a different situation from a person watching a spinner.

Worth checking at the same time whether any other synchronous handler takes a lock that a background job can hold.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions