Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • heptapod heptapod
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • heptapodheptapod
  • heptapodheptapod
  • Merge requests
  • !17

Workaround for hg controller with chunked Transfer-Encoding

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Georges Racinet requested to merge topic/heptapod/hgserve-chunked into branch/heptapod Apr 24, 2019
  • Overview 1
  • Commits 1
  • Pipelines 1
  • Changes 1

The inner Hg WSGI machinery uses Transfer-Encoding: chunked for most bundle-related operations. This is in general masked by the hg serve command (not sure it's 100%), which is not suited for production ops.

Gunicorn, and probably other production-grade WSGI servers just honor the chunked encoding.

However, it turns out that the way we use HTTParty and/or Rails base classes has the effect of "dechunking" the body, without clearing the header, making the response invalid. In normal GitLab operation, gitlab-workhorse, the inner layer of reverse proxy simply truncates the body.

The present change is just a workaround: it solves the invalidity of the response, instead of the true issue. Instead, we should stream the Hg response in its native chunked form, something like ActionController::Live (https://api.rubyonrails.org/classes/ActionController/Live.html)

Whether that is an effect of HTTParty forcing the whole body read or of send_data or how they interact remains to be found.

--HG-- branch : heptapod

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: topic/heptapod/hgserve-chunked