- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
当我查看 resque-web (localhost) 上的“workers”选项卡时出现运行时错误。其他一切正常。
编辑:发生此错误时,我还有一些(3 或 4 个)未知工作人员“不工作”。我认为他们应对错误负责,但我不明白他们是如何到达这里的。只有当我从上帝开始 worker 时才会发生
你能帮我解决这个问题吗?我做错了什么吗?
配置:Resque 1.8.5 作为 Snow Leopard 上 rails 2.3.8 应用程序中的 gemredis 1.0.7/rack 1.1/sinatra 1.0/vegas 0.1.7
回溯:
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in format_error_reply
*
551. when DOLLAR then format_bulk_reply(line)
552. when ASTERISK then format_multi_bulk_reply(line)
553. else raise ProtocolError.new(reply_type)
554. end
555. end
556.
557. def format_error_reply(line)
558. raise "-" + line.strip
559. end
560.
561. def format_status_reply(line)
562. line.strip
563. end
564.
565. def format_integer_reply(line)
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in format_reply
*
541.
542. def reconnect
543. disconnect && connect_to_server
544. end
545.
546. def format_reply(reply_type, line)
547. case reply_type
548. when MINUS then format_error_reply(line)
549. when PLUS then format_status_reply(line)
550. when COLON then format_integer_reply(line)
551. when DOLLAR then format_bulk_reply(line)
552. when ASTERISK then format_multi_bulk_reply(line)
553. else raise ProtocolError.new(reply_type)
554. end
555. end
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in read_reply
*
478. disconnect
479.
480. raise Errno::EAGAIN, "Timeout reading from the socket"
481. end
482.
483. raise Errno::ECONNRESET, "Connection lost" unless reply_type
484.
485. format_reply(reply_type, @sock.gets)
486. end
487.
488.
489. if "".respond_to?(:bytesize)
490. def get_size(string)
491. string.bytesize
492. end
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in process_command
*
448. return pipeline ? results : results[0]
449. end
450.
451. def process_command(command, argvv)
452. @sock.write(command)
453. argvv.map do |argv|
454. processor = REPLY_PROCESSOR[argv[0].to_s]
455. processor ? processor.call(read_reply) : read_reply
456. end
457. end
458.
459. def maybe_lock(&block)
460. if @thread_safe
461. @mutex.synchronize(&block)
462. else
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in map
*
446. end
447.
448. return pipeline ? results : results[0]
449. end
450.
451. def process_command(command, argvv)
452. @sock.write(command)
453. argvv.map do |argv|
454. processor = REPLY_PROCESSOR[argv[0].to_s]
455. processor ? processor.call(read_reply) : read_reply
456. end
457. end
458.
459. def maybe_lock(&block)
460. if @thread_safe
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in process_command
*
446. end
447.
448. return pipeline ? results : results[0]
449. end
450.
451. def process_command(command, argvv)
452. @sock.write(command)
453. argvv.map do |argv|
454. processor = REPLY_PROCESSOR[argv[0].to_s]
455. processor ? processor.call(read_reply) : read_reply
456. end
457. end
458.
459. def maybe_lock(&block)
460. if @thread_safe
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in raw_call_command
*
435. @sock.write(command)
436. return true
437. end
438. # The normal command execution is reading and processing the reply.
439. results = maybe_lock do
440. begin
441. set_socket_timeout!(0) if requires_timeout_reset?(argvv[0][0].to_s)
442. process_command(command, argvv)
443. ensure
444. set_socket_timeout!(@timeout) if requires_timeout_reset?(argvv[0][0].to_s)
445. end
446. end
447.
448. return pipeline ? results : results[0]
449. end
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in synchronize
*
454. processor = REPLY_PROCESSOR[argv[0].to_s]
455. processor ? processor.call(read_reply) : read_reply
456. end
457. end
458.
459. def maybe_lock(&block)
460. if @thread_safe
461. @mutex.synchronize(&block)
462. else
463. block.call
464. end
465. end
466.
467. def read_reply
468.
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in maybe_lock
*
454. processor = REPLY_PROCESSOR[argv[0].to_s]
455. processor ? processor.call(read_reply) : read_reply
456. end
457. end
458.
459. def maybe_lock(&block)
460. if @thread_safe
461. @mutex.synchronize(&block)
462. else
463. block.call
464. end
465. end
466.
467. def read_reply
468.
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in raw_call_command
*
432. end
433. # When in Pub/Sub mode we don't read replies synchronously.
434. if @pubsub
435. @sock.write(command)
436. return true
437. end
438. # The normal command execution is reading and processing the reply.
439. results = maybe_lock do
440. begin
441. set_socket_timeout!(0) if requires_timeout_reset?(argvv[0][0].to_s)
442. process_command(command, argvv)
443. ensure
444. set_socket_timeout!(@timeout) if requires_timeout_reset?(argvv[0][0].to_s)
445. end
446. end
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in call_command
*
336. # try to reconnect just one time, otherwise let the error araise.
337. def call_command(argv)
338. log(argv.inspect, :debug)
339.
340. connect_to_server unless connected?
341.
342. begin
343. raw_call_command(argv.dup)
344. rescue Errno::ECONNRESET, Errno::EPIPE, Errno::ECONNABORTED
345. if reconnect
346. raw_call_command(argv.dup)
347. else
348. raise Errno::ECONNRESET
349. end
350. end
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in method_missing
*
385. connect_to(@host, @port)
386. call_command([:auth, @password]) if @password
387. call_command([:select, @db]) if @db != 0
388. @sock
389. end
390.
391. def method_missing(*argv)
392. call_command(argv)
393. end
394.
395. def raw_call_command(argvp)
396. if argvp[0].is_a?(Array)
397. argvv = argvp
398. pipeline = true
399. else
* /Library/Ruby/Gems/1.8/gems/redis-namespace-0.4.4/lib/redis/namespace.rb in send
*
159. args = add_namespace(args)
160. args.push(last) if last
161. when :alternate
162. args = [ add_namespace(Hash[*args]) ]
163. end
164.
165. # Dispatch the command to Redis and store the result.
166. result = @redis.send(command, *args, &block)
167.
168. # Remove the namespace from results that are keys.
169. result = rem_namespace(result) if after == :all
170.
171. result
172. end
173.
* /Library/Ruby/Gems/1.8/gems/redis-namespace-0.4.4/lib/redis/namespace.rb in method_missing
*
159. args = add_namespace(args)
160. args.push(last) if last
161. when :alternate
162. args = [ add_namespace(Hash[*args]) ]
163. end
164.
165. # Dispatch the command to Redis and store the result.
166. result = @redis.send(command, *args, &block)
167.
168. # Remove the namespace from results that are keys.
169. result = rem_namespace(result) if after == :all
170.
171. result
172. end
173.
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/lib/resque/worker.rb in state
*
416. def idle?
417. state == :idle
418. end
419.
420. # Returns a symbol representing the current worker state,
421. # which can be either :working or :idle
422. def state
423. redis.exists("worker:#{self}") ? :working : :idle
424. end
425.
426. # Is this worker the same as another worker?
427. def ==(other)
428. to_s == other.to_s
429. end
430.
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/lib/resque/server/views/workers.erb in __tilt_a2112543c5200dbe0635da5124b47311
*
46. <tr>
47. <th> </th>
48. <th>Where</th>
49. <th>Queues</th>
50. <th>Processing</th>
51. </tr>
52. <% for worker in (workers = resque.workers.sort_by { |w| w.to_s }) %>
53. <tr class="<%=state = worker.state%>">
54. <td class='icon'><img src="<%=u state %>.png" alt="<%= state %>" title="<%= state %>"></td>
55.
56. <% host, pid, queues = worker.to_s.split(':') %>
57. <td class='where'><a href="<%=u "workers/#{worker}"%>"><%= host %>:<%= pid %></a></td>
58. <td class='queues'><%= queues.split(',').map { |q| '<a class="queue-tag" href="' + u("/queues/#{q}") + '">' + q + '</a>'}.join('') %></td>
59.
60. <td class='process'>
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/lib/resque/server/views/workers.erb in each
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/lib/resque/server/views/workers.erb in __tilt_a2112543c5200dbe0635da5124b47311
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/tilt.rb in send
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/tilt.rb in evaluate
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/tilt.rb in render
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in render
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in erb
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/lib/resque/server.rb in show
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/lib/resque/server.rb in GET /workers
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in call
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in route
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in instance_eval
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in route_eval
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in route!
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in catch
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in route!
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in each
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in route!
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in dispatch!
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in call!
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in instance_eval
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in invoke
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in catch
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in invoke
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in call!
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in call
* /Volumes/Donnees/Users/**/.gem/ruby/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb in call
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in call
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in synchronize
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in call
* /Volumes/Donnees/Users/**/.gem/ruby/1.8/gems/rack-1.1.0/lib/rack/content_length.rb in call
* /Volumes/Donnees/Users/**/.gem/ruby/1.8/gems/rack-1.1.0/lib/rack/chunked.rb in call
* /Volumes/Donnees/Users/**/.gem/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb in process
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in process_client
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in each
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in process_client
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in run
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in initialize
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in new
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in run
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in initialize
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in new
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in run
* /Volumes/Donnees/Users/**/.gem/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb in run
* /Library/Ruby/Gems/1.8/gems/vegas-0.1.7/lib/vegas/runner.rb in run!
* /Library/Ruby/Gems/1.8/gems/vegas-0.1.7/lib/vegas/runner.rb in start
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/bin/resque-web in new
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/bin/resque-web in nil
* /usr/bin/resque-web in load
最佳答案
我发现了问题:
在 god 配置文件中,我有(在 QUEUE 中逗号后有空格):
num_workers.times do |num|
God.watch do |w|
w.name = "resque-#{num}"
w.group = 'resque'
w.interval = 30.seconds
w.env = {"QUEUE"=>"critical, high, low", "RAILS_ENV"=>rails_env}
而不是(逗号后没有空格):
num_workers.times do |num|
God.watch do |w|
w.name = "resque-#{num}"
w.group = 'resque'
w.interval = 30.seconds
w.env = {"QUEUE"=>"critical,high,low", "RAILS_ENV"=>rails_env}
现在可以了!!
关于ruby - 在/workers : wrong number of arguments for 'exists' command 处请求运行时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2905358/
如果一个域有多个团队和多个 Web 应用程序,那么注册 Service Worker 来管理整个站点的最佳建议是什么?具有范围的顶级服务 worker /或子域中的多个服务 worker ?由于一个域
我开发了一个应用程序来分析播放 YouTube 视频时的网络流量。它使用 chrome.webRequest,我使用 onHeadersReceived 事件计算流量。 我想使用 service wo
假设我提供了不同网站使用的推送通知服务。此服务需要在我的客户站点上安装服务 worker 。我希望架构具有一些属性: 完全静态资源。安装service worker文件和配置JS片段等过程只需要完成一
我要缓存某人网站中的特定请求 ,那么我发现 service worker 是一个不错的选择。但我找不到任何方法 通过 tampermonkey 注入(inject)一个 service worker
当 Service Worker 更新时,它不会以正确的方式控制页面;它进入“等待”状态,等待被激活。 令人惊讶的是,更新后的 Service Worker 甚至在刷新页面后都无法控制选项卡。谷歌解释
有谁知道是否有办法在 service worker 中获取此号码或日期: 将我的服务 worker 缓存命名为 cache-1182 会很方便或 cache-20171127171448 我想在安装事
这link说: Workers may spawn more workers if they wish. So-called sub-workers must be hosted within the
有许多关于使用 ngsw-worker.js 安装 ServiceWorker 的分步指南;然而,甚至没有关于使用 safety-worker.js 卸载 ServiceWorker 的分步指南。 s
我正在尝试为我的网站使用后台定期同步。我正在使用 localhost 并在 1*1000 毫秒时注册 periodicsync 事件,但这根本不会触发。 我看过这个demo ,但即使我将该网站安装为应
我试图让用户安排一个周期性任务。我还在一个容器中运行多个 celery worker 。我对该容器的命令过去是这样的: celery worker -c 4 -B -l INFO -A my.cele
从我所看到的,你甚至可以缓存一个网页。根据此文档:https://www.mnot.net/cache_docs/#BROWSER ,表示可以缓存在浏览器缓存中。我看到即使是 serviceworke
我只是在测试 Service Worker 的功能以了解其工作原理。所以现在我遇到了一个问题。 var CACHE_NAME = 'my-site-cache-v1'; var urlsToCache
下图显示安装了两名工作人员 - 一名处于事件状态,另一名未处于事件状态(刚刚安装)。 注册 service worker 更改 service-worker.js并重新加载页面。 逻辑是 Servic
我正在尝试学习渐进式 Web 应用程序的一些基础知识,并且在我阅读的其中一篇教程中学习 [在安装了 service worker 并且用户导航到不同的页面或刷新后,service worker 将开始
我正在开发一个应用程序,其目标是定期(例如每小时)向用户发送通知。 我的想法是使用一个可以在选项卡关闭后运行的服务 worker ,并继续向用户发送这些通知。 网页需要能够与 Service Work
我正在尝试为一个简单但旧的 Django Web 应用程序安装 ServiceWorker。我开始使用示例 read-through caching example from the Chrome t
在我们开发的情况下,我们提供来自 https://localhost 的文件因为该应用程序托管在 salesforce.com 中。在 chrome service worker 中,chrome 会
我是服务人员的新手,并且浏览了各种文档(Google,Mozilla,serviceworke.rs,Github,StackOverflow questions)。最有用的是ServiceWorke
我正在解决一个问题,我有一组“热情的 worker ”。这意味着它们被维护在内存中,维护自己的上下文并且是可调用的。我一直在研究各种 Go Worker 实现,但都依赖于闭包或返回结果的简单计算函数。
我有一个部署到静态服务器的非根路径的网络应用程序。即MyApp构建时部署到路径/文件夹 https://example.com/myapp . MyApp正在使用 vue 和 webpack 所以我添
我是一名优秀的程序员,十分优秀!