Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: symfony/doctrine-messenger
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 227cbb2
Choose a base ref
...
head repository: symfony/doctrine-messenger
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 78ec63b
Choose a head ref
  • 12 commits
  • 10 files changed
  • 5 contributors

Commits on Apr 5, 2024

  1. Configuration menu
    Copy the full SHA
    1d96852 View commit details
    Browse the repository at this point in the history
  2. bug #54105 [Messenger] Improve deadlock handling on ack() and `reje…

    …ct()` (jwage)
    
    This PR was squashed before being merged into the 6.4 branch.
    
    Discussion
    ----------
    
    [Messenger] Improve deadlock handling on `ack()` and `reject()`
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.4
    | Bug fix?      | yes
    | New feature?  | no
    | Deprecations? | no
    | Issues        | Fix #54103
    | License       | MIT
    
    We started getting this deadlock recently. It has happened only twice so far under high load.
    
    ```
    SQLSTATE[40P01]: Deadlock detected: 7 ERROR:  deadlock detected
    DETAIL:  Process 221664 waits for ShareLock on transaction 59539641; blocked by process 221671.
    Process 221671 waits for AccessExclusiveLock on tuple (77,27) of relation 16455 of database 16385; blocked by process 221605.
    Process 221605 waits for ShareLock on transaction 59539646; blocked by process 221606.
    Process 221606 waits for AccessExclusiveLock on tuple (69,16) of relation 16455 of database 16385; blocked by process 221664.
    HINT:  See server log for query details.
    CONTEXT:  while deleting tuple (69,16) in relation "messenger_messages"
    Process 221664 waits for ShareLock on transaction 59539641;
    blocked by process 221671.
    ```
    
    Here are the queries for each process:
    
    ```
    Process 221664 waits for ShareLock on transaction 59539641;
    blocked by process 221671.
    
    221671
    SELECT m.* FROM messenger_messages m WHERE (m.queue_name = $1) AND (m.delivered_at is null OR m.delivered_at < $2) AND (m.available_at <= $3) ORDER BY available_at ASC LIMIT 1 FOR UPDATE
    
    221605
    SELECT m.* FROM messenger_messages m WHERE (m.queue_name = $1) AND (m.delivered_at is null OR m.delivered_at < $2) AND (m.available_at <= $3) ORDER BY available_at ASC LIMIT 1 FOR UPDATE
    
    221606
    SELECT m.* FROM messenger_messages m WHERE (m.queue_name = $1) AND (m.delivered_at is null OR m.delivered_at < $2) AND (m.available_at <= $3) ORDER BY available_at ASC LIMIT 1 FOR UPDATE
    
    221664
    DELETE FROM messenger_messages WHERE id = $1
    ```
    
    Open for discussion if this is the right way to handle this or not.
    
    TODO:
    
    - [x] Should there be a retry delay/exponential backoff/jitter? Retrying the failed delete that deadlocked immediately may not help.
    - [x] Should `skip_locked` even be an option or should we always use skip locked?
    - [x] Should we add `SKIP LOCKED` to the `FOR UPDATE`? It will reduce contention further. I was looking at how SolidQueue in Ruby On Rails handles this and it appears they use `SKIP LOCKED FOR UPDATE` https://github.com/basecamp/solid_queue/blob/fe57349a126efc381fe0adf4c1ec444bd8a4f53f/app/models/solid_queue/record.rb#L11
    
    Commits
    -------
    
    38b67e7d7f [Messenger] Improve deadlock handling on `ack()` and `reject()`
    fabpot committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    04c736d View commit details
    Browse the repository at this point in the history
  3. Merge branch '6.4' into 7.0

    * 6.4:
      fix merge
      fix syntax for PHP 7.2
      [Security] Fix Danish translations
      [Messenger] Improve deadlock handling on `ack()` and `reject()`
      [DomCrawler] Encode html entities only if nessecary
      [Serializer] reset backed_enum priority, and re-prioritise translatable
      [Validator] Accept `Stringable` in `ExecutionContext::build/addViolation()`
      [Serializer] Ignore when using #[Ignore] on a non-accessor
      [Filesystem] Strengthen the check of file permissions in `dumpFile`
      [Serializer] Fix XML scalar to object denormalization
      [HttpClient][EventSourceHttpClient] Fix consuming SSEs with \r\n separator
    xabbuh committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    c47fb9c View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2024

  1. Configuration menu
    Copy the full SHA
    43b8a99 View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2024

  1. fix tests

    xabbuh committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    dc2161c View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2024

  1. Merge branch '6.4' into 7.0

    * 6.4:
      initialize the current time with midnight before modifying the date
      fix tests
      [HtmlSanitizer] Ignore Processing Instructions
    xabbuh committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    93a16da View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2024

  1. Merge branch '5.4' into 6.4

    * 5.4:
      explicitly mark nullable parameters as nullable
      fix low deps tests
      [HttpKernel] Fix datacollector caster for reference object property
      bug #51578 [Cache] always select database for persistent redis connections
      [Security] Validate that CSRF token in form login is string similar to username/password
      [validator] validated Dutch translation
      Improve dutch translations
      [Translation] Skip state=needs-translation entries only when source == target
      [HttpKernel] Ensure controllers are not lazy
      [Validator] Fill in trans-unit id 113: This URL does not contain a TLD.
      [Validator] added missing Polish translation for unit 113
      [Validator] add missing lv translation
      [HttpClient] Let curl handle transfer encoding
      [Messenger] Make Doctrine connection ignore unrelated tables on setup
      [HttpFoundation] Set content-type header in RedirectResponse
      add translations for the requireTld constraint option message
      [Serializer] Fix unexpected allowed attributes
      [FrameworkBundle] Fix registration of the bundle path to translation
    xabbuh committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    418f8d8 View commit details
    Browse the repository at this point in the history
  2. fix merge

    xabbuh committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    9451747 View commit details
    Browse the repository at this point in the history
  3. Merge branch '6.4' into 7.0

    * 6.4: (23 commits)
      fix merge
      add missing return type-hints
      fix merge
      explicitly mark nullable parameters as nullable
      fix low deps tests
      [HttpKernel] Fix datacollector caster for reference object property
      [Serializer] Fixing PHP warning in the ObjectNormalizer with MaxDepth enabled
      bug #51578 [Cache] always select database for persistent redis connections
      [Security] Validate that CSRF token in form login is string similar to username/password
      [Serializer] Use explicit nullable type
      [validator] validated Dutch translation
      Improve dutch translations
      [Translation] Skip state=needs-translation entries only when source == target
      [HttpKernel] Ensure controllers are not lazy
      [Validator] Fill in trans-unit id 113: This URL does not contain a TLD.
      [Validator] added missing Polish translation for unit 113
      [Validator] add missing lv translation
      [HttpClient] Let curl handle transfer encoding
      [Messenger] Make Doctrine connection ignore unrelated tables on setup
      [HttpFoundation] Set content-type header in RedirectResponse
      ...
    xabbuh committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    9e3dde0 View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2024

  1. Configuration menu
    Copy the full SHA
    b72331f View commit details
    Browse the repository at this point in the history
  2. Merge branch '5.4' into 6.4

    * 5.4:
      Auto-close PRs on subtree-splits
      review German translation
    nicolas-grekas committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    f850f47 View commit details
    Browse the repository at this point in the history
  3. Merge branch '6.4' into 7.0

    * 6.4:
      Auto-close PRs on subtree-splits
      review German translation
    nicolas-grekas committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    78ec63b View commit details
    Browse the repository at this point in the history
Loading