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

Fix: Make sure that missing supervisors are correctly displayed when using multiple environments #1294

Conversation

PrinsFrank
Copy link
Contributor

@PrinsFrank PrinsFrank commented Jul 12, 2023

When displaying active/inactive supervisors for a master supervisor that is started with a different environment, the provisioning in the overview is done with the configuration of the environment the horizon endpoint runs on, causing a potential mismatch when using different environments. This PR passes the environment to the master and uses that variable to display a correct overview. (See discussion in PR #1286 for a reproduction)

@PrinsFrank PrinsFrank changed the title Make sure that active supervisors are matched based on environment of master supervisor Fix: Make sure that missing supervisors are correctly displayed when using multiple environments Jul 12, 2023
@PrinsFrank PrinsFrank force-pushed the fix-inactive-supervisors-shown-on-different-env branch from 949d161 to 1e5181e Compare July 12, 2023 20:20
src/MasterSupervisor.php Outdated Show resolved Hide resolved
@PrinsFrank PrinsFrank force-pushed the fix-inactive-supervisors-shown-on-different-env branch from 1e5181e to 42fdd07 Compare July 13, 2023 07:49
@taylorotwell
Copy link
Member

Why would the environments be different?

@PrinsFrank
Copy link
Contributor Author

PrinsFrank commented Jul 13, 2023

Why would the environments be different?

In the linked PR @bjarn had an example where there were multiple environments with different supervisor configurations.

I've seen this setup at more larger companies, and it provides another dimension of scalability. For example, you can use 3 default configured pods running the default production supervisors, but then when there is a workload on a specific queue that is suffocating the other queues, you can add a dedicated pod for a different environment running only that queue.

[
    'production' => [ // Started with "php artisan horizon"
        'supervisor-1' => [
            'queues' => ['default', 'low-prio', 'high-prio', 'index']
        ],
    ],
    'production-index' => [ // Started with "php artisan horizon --environment=production-index"
        'supervisor-1' => [
            'queues' => ['index']
        ],
    ],
]

@taylorotwell taylorotwell merged commit ab618d1 into laravel:5.x Jul 14, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants