Unable to render huge list of revisions


(Jnns) #1

We have a wiki topic on our Discourse installation that is updated every hour by a cronjob and therefore has a huge list of revisions (around 800 edits by now).

This leads to the list of revisions not being rendered and /posts/<id>/revisions/latest.json returning a 502 bad gateway error. I reckon this is a very peculiar use case and thus may not be of interest because only few folks will ever encounter this. But I thought I’d leave this here for future reference in case fetching of revisions is being overhauled someday.


(Régis Hanol) #2

Can you provide more information? Anything related in /logs?
The exception message and the stacktrace would be helpful.


(Jnns) #3

Got only this in ./logs/production.log

Started GET "/posts/81/revisions/latest.json?_=1493215926966" for 93.220.17.27 at 2017-04-26 14:12:17 +0000
Processing by PostsController#latest_revision as JSON
  Parameters: {"_"=>"1493215926966", "post_id"=>"81"}
Started GET "/posts/81/revisions/latest.json?_=1493215926967" for 93.220.17.27 at 2017-04-26 14:12:25 +0000
Processing by PostsController#latest_revision as JSON
  Parameters: {"_"=>"1493215926967", "post_id"=>"81"}

Now upon trying to gather more information for you, it seems to work:

Started GET "/posts/81/revisions/latest.json?_=1493215926968" for 93.220.17.27 at 2017-04-26 14:24:24 +0000
Processing by PostsController#latest_revision as JSON
  Parameters: {"_"=>"1493215926968", "post_id"=>"81"}
Completed 200 OK in 20598ms (Views: 19.8ms | ActiveRecord: 4043.2ms)
Started GET "/posts/81/revisions/888.json?_=1493215926969" for 93.220.17.27 at 2017-04-26 14:25:10 +0000
Processing by PostsController#revisions as JSON
  Parameters: {"_"=>"1493215926969", "post_id"=>"81", "revision"=>"888"}
Completed 200 OK in 20927ms (Views: 14.2ms | ActiveRecord: 5589.1ms)

This is what ./logs/unicorn.stderr.log has to offer:

I, [2017-04-26T07:41:13.272813 #31630]  INFO -- : master done reopening logs
I, [2017-04-26T07:41:13.441169 #31687]  INFO -- : worker=0 done reopening logs
I, [2017-04-26T07:41:13.498794 #4981]  INFO -- : worker=1 done reopening logs
E, [2017-04-26T13:16:30.818658 #31630] ERROR -- : worker=0 PID:31687 timeout (31s > 30s), killing
E, [2017-04-26T13:16:30.929419 #31630] ERROR -- : reaped #<Process::Status: pid 31687 SIGKILL (signal 9)> worker=0
I, [2017-04-26T13:16:51.868618 #7822]  INFO -- : worker=0 ready
D, [2017-04-26T13:17:02.136841 #31630] DEBUG -- : waiting 16.0s after suspend/hibernation
E, [2017-04-26T13:17:18.193425 #31630] ERROR -- : worker=1 PID:4981 timeout (41s > 30s), killing
E, [2017-04-26T13:17:18.312592 #31630] ERROR -- : reaped #<Process::Status: pid 4981 SIGKILL (signal 9)> worker=1
I, [2017-04-26T13:17:27.075560 #7985]  INFO -- : worker=1 ready
E, [2017-04-26T14:12:48.329692 #31630] ERROR -- : worker=0 PID:7822 timeout (31s > 30s), killing
E, [2017-04-26T14:12:48.933713 #31630] ERROR -- : reaped #<Process::Status: pid 7822 SIGKILL (signal 9)> worker=0
E, [2017-04-26T14:12:55.983592 #31630] ERROR -- : worker=1 PID:7985 timeout (31s > 30s), killing
E, [2017-04-26T14:12:56.127787 #31630] ERROR -- : reaped #<Process::Status: pid 7985 SIGKILL (signal 9)> worker=1
I, [2017-04-26T14:13:00.327716 #12034]  INFO -- : worker=0 ready
I, [2017-04-26T14:13:04.801019 #12084]  INFO -- : worker=1 ready
D, [2017-04-26T14:13:26.150843 #31630] DEBUG -- : waiting 16.0s after suspend/hibernation                                                                                     

Unfortunately there’s nothing in /logs about the aborted processes.