diff --git a/doc/administration/environment_variables.md b/doc/administration/environment_variables.md index 0997701e9cb0718889fba15dbe3da5657e70bf5f..1854b1d0b077bd0dad420eea072615273b40e1bc 100644 --- a/doc/administration/environment_variables.md +++ b/doc/administration/environment_variables.md @@ -43,6 +43,7 @@ You can use the following environment variables to override certain values: | `GITLAB_RAILS_CACHE_DEFAULT_TTL_SECONDS` | integer | The default TTL used for entries stored in the Rails-cache. Default is `28800`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95042) in 15.3. | | `GITLAB_CI_CONFIG_FETCH_TIMEOUT_SECONDS` | integer | Timeout for resolving remote includes in CI config in seconds. Must be between `0` and `60`. Default is `30`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116383) in 15.11. | | `GITLAB_DISABLE_TOKEN_EXPIRATION_BANNER` | string | If set to `true`, `1`, or `yes`, the token expiration banner is not shown. Default is `false`. | +| `GITLAB_DISABLE_MARKDOWN_TIMEOUT` | string | If set to `true`, `1`, or `yes`, Markdown rendering on the backend does not time out. Default is `false`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/163662) in 17.4.| | `GITLAB_LFS_MAX_OID_TO_FETCH` | integer | Sets the maximum number of LFS objects to link. Default is `100,000`. | | `SIDEKIQ_SEMI_RELIABLE_FETCH_TIMEOUT` | integer | Sets the timeout for Sidekiq semi-reliable fetch. Default is `5`. [Before GitLab 16.7](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139583), default was `3`. If you experience high Redis CPU consumption on GitLab 16.6 and earlier, or if you have customized this variable, you should update this variable to `5`. | diff --git a/lib/gitlab/render_timeout.rb b/lib/gitlab/render_timeout.rb index 85c844949380651a76730db75f8573285b298ace..d1411385834d7bd28f6ab49f6ab8934571bf79f4 100644 --- a/lib/gitlab/render_timeout.rb +++ b/lib/gitlab/render_timeout.rb @@ -12,7 +12,7 @@ def self.timeout(background: BACKGROUND, foreground: FOREGROUND, &block) end def self.banzai_timeout_disabled? - Gitlab::Utils.to_boolean(ENV['DISABLE_BANZAI_TIMEOUT'], default: false) + Gitlab::Utils.to_boolean(ENV['GITLAB_DISABLE_MARKDOWN_TIMEOUT'], default: false) end end end diff --git a/spec/lib/banzai/filter/concerns/pipeline_timing_check_spec.rb b/spec/lib/banzai/filter/concerns/pipeline_timing_check_spec.rb index 44771f5aac4ec36e9a243f1fd5238063f8819ec0..357f4fc4e2b709fc03a43fcd2a6079674e880ded 100644 --- a/spec/lib/banzai/filter/concerns/pipeline_timing_check_spec.rb +++ b/spec/lib/banzai/filter/concerns/pipeline_timing_check_spec.rb @@ -28,9 +28,9 @@ expect(described_class.new('text').exceeded_pipeline_max?).to be_falsey end - context 'when DISABLE_BANZAI_TIMEOUT set' do + context 'when GITLAB_DISABLE_MARKDOWN_TIMEOUT set' do it 'ignores MAX_PIPELINE_SECONDS' do - stub_env('DISABLE_BANZAI_TIMEOUT' => '1') + stub_env('GITLAB_DISABLE_MARKDOWN_TIMEOUT' => '1') allow_next_instance_of(described_class) do |instance| allow(instance).to receive(:result).and_return({ pipeline_timing: 1.1 }) end diff --git a/spec/lib/banzai/filter/concerns/timeout_filter_handler_spec.rb b/spec/lib/banzai/filter/concerns/timeout_filter_handler_spec.rb index b02448d1a3bbc96ab863af672ad8e4241302c3cf..f847f46565c32c8fdfda606baf7908bf622dda84 100644 --- a/spec/lib/banzai/filter/concerns/timeout_filter_handler_spec.rb +++ b/spec/lib/banzai/filter/concerns/timeout_filter_handler_spec.rb @@ -39,9 +39,9 @@ end end - context 'when DISABLE_BANZAI_TIMEOUT set' do + context 'when GITLAB_DISABLE_MARKDOWN_TIMEOUT set' do before do - stub_env('DISABLE_BANZAI_TIMEOUT' => '1') + stub_env('GITLAB_DISABLE_MARKDOWN_TIMEOUT' => '1') stub_const 'TimeoutTest', Class.new(HTML::Pipeline::Filter) TimeoutTest.class_eval { include Banzai::Filter::Concerns::TimeoutFilterHandler } end diff --git a/spec/lib/gitlab/render_timeout_spec.rb b/spec/lib/gitlab/render_timeout_spec.rb index c9ed825ddf31645fdcd41a13a538fc49fa822ca2..7cf1f6e0aae4b9d89867e10891d179d74c285fdc 100644 --- a/spec/lib/gitlab/render_timeout_spec.rb +++ b/spec/lib/gitlab/render_timeout_spec.rb @@ -24,15 +24,15 @@ def expect_timeout(period) end describe 'banzai_timeout_disabled?' do - context 'when DISABLE_BANZAI_TIMEOUT set' do + context 'when GITLAB_DISABLE_MARKDOWN_TIMEOUT set' do it 'returns true' do - stub_env('DISABLE_BANZAI_TIMEOUT' => '1') + stub_env('GITLAB_DISABLE_MARKDOWN_TIMEOUT' => '1') expect(described_class.banzai_timeout_disabled?).to be_truthy end end - context 'when DISABLE_BANZAI_TIMEOUT is not set' do + context 'when GITLAB_DISABLE_MARKDOWN_TIMEOUT is not set' do it 'returns false' do expect(described_class.banzai_timeout_disabled?).to be_falsey end