Skip to content

Conversation

@Flink
Copy link
Contributor

@Flink Flink commented Dec 1, 2025

This PR introduces a web server adapter for the upgrader class. This allows the upgrader to work with both Unicorn and Pitchfork.

The user experience when watching the upgrade process from the admin page should stay the same.


Relies on discourse/discourse#36456

@Flink Flink self-assigned this Dec 1, 2025
@Flink Flink force-pushed the loic/pitchfork-compat branch from 2cab65b to 3db3a67 Compare December 12, 2025 16:54
Comment on lines -62 to -67
if ENV["UNICORN_SIDEKIQS"].to_i > 0
log "Stopping job queue to reclaim memory, master pid is #{master_pid}"
Process.kill("TSTP", unicorn_master_pid)
sleep 1
# older versions do not have support, so quickly send a cont so master process is not hung
Process.kill("CONT", unicorn_master_pid)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually doesn’t work anymore. It hasn’t for some time now, at least one year (see discourse/discourse#27257).

end

def reload
set_restart_flag
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With #set_restart_flag/#clear_restart_flag, we’re signaling MessageBus to allow its poll call to wait for the server response instead of its default behavior of killing the request after 100 ms.

This patch introduces a web server adapter for the upgrader class. This
allows the upgrader to work with both Unicorn and Pitchfork.

The user experience when watching the upgrade process from the admin page
should stay the same.
Flink added a commit to discourse/discourse that referenced this pull request Dec 18, 2025
This brings the necessary changes to allow the `docker_manager` plugin
to work properly with Pitchfork (see
discourse/docker_manager#293).

Three things are needed:
- Tell our MessageBus config to not return a 429 if a request takes more
than 100 ms while the Pitchfork server is restarting.
- Update the Pitchfork config to allow it to reuse its own port (this
allows us to start a new Pitchfork server while the old one is still
running)
- Update the `unicorn_launcher` script to restart the Pitchfork server
when it receives a USR2/HUP signal. This way, it doesn’t complicate
things too much.
@Flink Flink merged commit f1b3d34 into main Dec 18, 2025
10 checks passed
@Flink Flink deleted the loic/pitchfork-compat branch December 18, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants