无法启动开发实例-- renice:设置优先级失败

我不知道自从我上次启动这个开发实例以来有什么可能改变了,但现在它像这样失败了:

Sidekiq client with Sidekiq::RedisConnection::RedisAdapter options {:host=>"localhost", :port=>6379, :namespace=>"sidekiq"}
Sidekiq client with Sidekiq::RedisConnection::RedisAdapter options {:host=>"localhost", :port=>6379, :namespace=>"sidekiq"}
Sidekiq client with Sidekiq::RedisConnection::RedisAdapter options {:host=>"localhost", :port=>6379, :namespace=>"sidekiq"}
I, [2023-05-17T13:31:56.328911 #1103707]  INFO -- : worker=0 ready                                                           
I, [2023-05-17T13:31:56.330855 #1103710]  INFO -- : worker=1 ready                                                         
Loading Sidekiq in process id 1103706                                                                                        
Sidekiq client with Sidekiq::RedisConnection::RedisAdapter options {:host=>"localhost", :port=>6379, :namespace=>"sidekiq"}  
/home/pfaffman/src/discourse-repos/discourse/lib/discourse.rb:137:in `exec': renice: failed to set priority for 1103706 (proc
ess ID): Permission denied                                                                                                   
/home/pfaffman/src/discourse-repos/discourse/lib/discourse.rb:171:in `execute_command'   
/home/pfaffman/src/discourse-repos/discourse/lib/discourse.rb:137:in `exec'                                             
/home/pfaffman/src/discourse-repos/discourse/lib/discourse.rb:33:in `execute_command'                                
/home/pfaffman/src/discourse-repos/discourse/lib/demon/sidekiq.rb:51:in `after_fork'
/home/pfaffman/src/discourse-repos/discourse/lib/demon/base.rb:155:in `block in run'                            
/home/pfaffman/src/discourse-repos/discourse/lib/demon/base.rb:151:in `fork'
/home/pfaffman/src/discourse-repos/discourse/lib/demon/base.rb:151:in `run'                                                  
/home/pfaffman/src/discourse-repos/discourse/lib/demon/base.rb:146:in `start'                                   
/home/pfaffman/src/discourse-repos/discourse/lib/demon/base.rb:14:in `block in start'                                        
/home/pfaffman/src/discourse-repos/discourse/lib/demon/base.rb:14:in `times'                                               
/home/pfaffman/src/discourse-repos/discourse/lib/demon/base.rb:14:in `start'                                                 
/home/pfaffman/src/discourse-repos/discourse/config/unicorn.conf.rb:89:in `block in reload'                                  
/home/pfaffman/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb:541:in `spawn_missing_workers'                                                                                                                 
/home/pfaffman/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb:143:in `start'
/home/pfaffman/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/unicorn-6.1.0/bin/unicorn:128:in `<top (required)>'
/home/pfaffman/src/discourse-repos/discourse/bin/unicorn:96:in `load'                
/home/pfaffman/src/discourse-repos/discourse/bin/unicorn:96:in `block in <main>'    
/home/pfaffman/src/discourse-repos/discourse/bin/unicorn:95:in `fork'                                           
/home/pfaffman/src/discourse-repos/discourse/bin/unicorn:95:in `<main>'                                                      
I, [2023-05-17T13:31:56.356176 #1103713]  INFO -- : worker=2 ready                                                         
E, [2023-05-17T13:31:56.452446 #1103437] ERROR -- : reaped #<Process::Status: pid 1103706 exit 1> worker=unknown             
Detected dead worker 1103706, restarting...                                                                                  
 

而且我做了我唯一能想到的另一件事:重启。 :shrimp: (耸肩的表情符号似乎不见了——我刚刚重启了——我想他们正在尝试使用新的 Font Awesome 图标——所以这里有一个虾。)

4 个赞

我对此仍感到困惑。我在 lib/demon/sidekiq.rb 中注释掉了这一行:

     #Discourse::Utils.execute_command("renice", "-n", "5", "-p", Process.pid.to_s)

这一行已经存在 4 年了,上次我启动它时它还能正常工作。我不知道可能有什么变化。内核升级,也许?但那也说不通。

1 个赞

docker 镜像的一次更新可能包含了对 renice 等工具的更新。或者容器内的某种策略更新可能碍事了,例如不同的 UID 以不同的方式用于不同的进程。或者基础优先级可能已更改,导致 renice 现在尝试提高优先级,但它无法做到。

这是用于 Linux 上的开发实例,不在容器中。奇怪的是只有我一个人,但我经常能想到别人想不到的愚蠢方法。

1 个赞

啊,抱歉——我对开发实例没有经验。

2 个赞

我也是。我几个小时前在我的本地 Kubernetes 上发现了同样的问题。

E, [2023-07-27T13:09:27.525053 #74] ERROR -- : reaped #<Process::Status: pid 456 exit 1> worker=unknown
检测到死 worker 456,正在重启...
/var/www/discourse/lib/discourse.rb:137:in `exec': renice: failed to set priority for 483 (process ID): Permission denied
/var/www/discourse/lib/discourse.rb:171:in `execute_command'
/var/www/discourse/lib/discourse.rb:137:in `exec'
/var/www/discourse/lib/discourse.rb:33:in `execute_command'
/var/www/discourse/lib/demon/sidekiq.rb:51:in `after_fork'
/var/www/discourse/lib/demon/base.rb:155:in `block in run'
/var/www/discourse/lib/demon/base.rb:151:in `fork'
/var/www/discourse/lib/demon/base.rb:151:in `run'
/var/www/discourse/lib/demon/base.rb:146:in `start'
/var/www/discourse/lib/demon/base.rb:132:in `ensure_running'
/var/www/discourse/lib/demon/base.rb:31:in `block in ensure_running'
/var/www/discourse/lib/demon/base.rb:31:in `each'
/var/www/discourse/lib/demon/base.rb:31:in `ensure_running'
config/unicorn.conf.rb:243:in `master_sleep'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb:295:in `join'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/unicorn-6.1.0/bin/unicorn:128:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.2.0/bin/unicorn:25:in `load'
/var/www/discourse/vendor/bundle/ruby/3.2.0/bin/unicorn:25:in `<main>'