Skip to content

Commit

Permalink
[Docs] Add notice for deadlock issue on doctrine messenger transport -
Browse files Browse the repository at this point in the history
…resolves #15698
  • Loading branch information
dvesh3 committed Aug 17, 2023
1 parent 5a48c59 commit 482a985
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ have a look at the logs as a starting point when debugging installation issues.


## 5. Maintenance Cron Job

Maintenance tasks are handled with Symfony Messenger. The `pimcore:maintenance` command will add the maintenance
messages to the bus and runs them afterwards immediately from the queue. However, it is recommended to set up independent
workers that process the queues, by running `bin/console messenger:consume pimcore_core pimcore_maintenance pimcore_image_optimize` (using e.g.
Expand All @@ -88,23 +87,7 @@ the queue directly.

Keep in mind, that the cron job has to run as the same user as the web interface to avoid permission issues (eg. `www-data`).

### Handle Failed jobs
If there are maintenance jobs that are failed in the processing, after defined retries they are discarded from the respective transport.
However, you can move the failed jobs to a new transport e.g. `pimcore_failed_jobs` instead of discarding them completely, with following config:
```yaml
framework:
messenger:
transports:
pimcore_failed_jobs:
dsn: "doctrine://default?queue_name=pimcore_failed_jobs&table_name=messenger_messages_pimcore_failed"

pimcore_core:
dsn: "doctrine://default?queue_name=pimcore_core"
failure_transport: pimcore_failed_jobs
```
which can be re-processed later after fixing the underlying issue with command `bin/console messenger:consume pimcore_failed_jobs`.

Please follow the [Symfony docs](https://symfony.com/doc/current/messenger.html#saving-retrying-failed-messages) for options on failed jobs processing.
Read more about the maintenance tasks here: [Maintenance Tasks](./08_Maintenance_Tasks.md)

## 6. Additional Information & Help

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Doctrine Transport
Pimcore ships with a Doctrine Transport for the Messenger component. This is done to reduce the dependencies and get the setup running more quickly.
If you are using Doctrine Transport for your maintenance jobs, you might face deadlock issue when running multiple workers.
We recommend to use a proper message queue like RabbitMQ or Redis for production environments.

Read more Symfony Messenger Transports [here](https://symfony.com/doc/current/messenger.html#transport-configuration).

### Handle Failed jobs
If there are maintenance jobs that are failed in the processing, after defined retries they are discarded from the respective transport.
However, you can move the failed jobs to a new transport e.g. `pimcore_failed_jobs` instead of discarding them completely, with following config:
```yaml
framework:
messenger:
transports:
pimcore_failed_jobs:
dsn: "doctrine://default?queue_name=pimcore_failed_jobs&table_name=messenger_messages_pimcore_failed"

pimcore_core:
dsn: "doctrine://default?queue_name=pimcore_core"
failure_transport: pimcore_failed_jobs
```
which can be re-processed later after fixing the underlying issue with command `bin/console messenger:consume pimcore_failed_jobs`.

Please follow the [Symfony docs](https://symfony.com/doc/current/messenger.html#saving-retrying-failed-messages) for options on failed jobs processing.

0 comments on commit 482a985

Please sign in to comment.