Thanks, 

I tried to disable syntax highlighting, but it did not seem to have helped. 
The page still returns 502. Here is the current content of my highligh.rb 
file:

module Gitlab
  class Highlight
    def self.highlight(blob_name, blob_content, nowrap: true)
      new(blob_name, blob_content, nowrap: nowrap).highlight(blob_content, 
continue: false)
    end

    def self.highlight_lines(repository, ref, file_name)
      blob = repository.blob_at(ref, file_name)
      return [] unless blob

      blob.load_all_data!(repository)
      highlight(file_name, blob.data).lines.map!(&:html_safe)
    end

    def initialize(blob_name, blob_content, nowrap: true)
      @formatter = rouge_formatter(nowrap: nowrap)
      @lexer = Rouge::Lexer.guess(filename: blob_name, source: 
blob_content).new rescue Rouge::Lexers::PlainText
    end

    def highlight(text, continue: true)
      @formatter.format(Rouge::Lexers::PlainText.lex(text)).html_safe
      #@formatter.format(@lexer.lex(text, continue: continue)).html_safe
    rescue
      @formatter.format(Rouge::Lexers::PlainText.lex(text)).html_safe
    end

    private

    def rouge_formatter(options = {})
      options = options.reverse_merge(
        nowrap: true,
        cssclass: 'code highlight',
        lineanchors: true,
        lineanchorsid: 'LC'
      )

      Rouge::Formatters::HTMLGitlab.new(options)
    end
  end
end


On Thursday, May 19, 2016 at 10:31:30 AM UTC-4, Stan Hu wrote:
>
> Yes, it's very possible it's due to syntax highlighting as described in 
> https://gitlab.com/gitlab-org/gitlab-ce/issues/17327.
>
>
> On Thu, May 19, 2016 at 9:20 AM, Romain Deterre <romain....@gmail.com 
> <javascript:>> wrote:
>
>> Thanks for your answer,
>>
>> On Thursday, May 19, 2016 at 9:52:30 AM UTC-4, Stan Hu wrote:
>>>
>>> Do you have an external CI configured? You may want to disable it:
>>>
>>
>> There is none, I have no .gitlab-ci.yml file in any of the current 
>> repositories on this server, and I did not do any CI-specific setup.
>>
>> The server on which GitLab runs has 16 GB of RAM, and there's 
>> consistently 7 GB available. On the other hand, CPU consumption goes to 
>> 100% on one of the cores when the request to view the page is in flight.
>>
>> I tried clicking 'Housekeeping' on the offending project, but it didn't 
>> seem to make any difference.
>>
>> I first saw the issue while trying to reply to a comment in a diff in the 
>> merge request. The page seemed to freeze right when the comment was added. 
>> Not sure if this information can help. The merge itself is quite small -- 
>> it changes about 500 lines of code in three files.
>>
>> Is it possible that this is related to  
>> https://gitlab.com/gitlab-org/gitlab-ce/issues/17327 ? If so, should I 
>> try to disable syntax highlighting?
>>
>> Thanks
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "GitLab" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to gitlabhq+u...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/gitlabhq/488bde17-e914-43ff-97ea-b3c669265a6d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/gitlabhq/488bde17-e914-43ff-97ea-b3c669265a6d%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitlabhq+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/gitlabhq/bef9c360-f18d-49e7-b914-0e9a4d3ff1a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to