• Stan Hu's avatar
    Disable Sendfile interface for serving Sidekiq Web assets · ba8bd315
    Stan Hu authored
    Sidekiq bundles its own CSS and JavaScript assets in the gem, and
    registers these via `Rack::Static`. By default, `Rack::Sendfile` will
    use the Sendfile interface if available to offload the sending to
    Workhorse. However, Workhorse might not have these assets, as they are
    bundled with the installed Ruby gem.
    
    Cloud Native GitLab worked around this issue by routing `/admin/sidekiq`
    directly to the webservice container, but this doesn't work if the NGINX
    ingress controller isn't used. Also, users have reported that the
    ordering of the rules may matter when another load balancer is used
    (https://gitlab.com/gitlab-org/charts/gitlab/-/issues/2731).
    
    To avoid these kinds of issues leading to 404s, we now disable the use
    of Sendfile for `admin/sidekiq` routes. These assets are small and
    served infrequently, so it should be fine to do this.
    
    Relates to
    https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/14150
    
    Changelog: changed
    ba8bd315
sidekiq_web_static.rb 647 Bytes