why use wait_for_termination method will stuck the code
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 30/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- ruby
调研方向
Start with the thread_pool.shutdown and thread_pool.wait_for_termination calls in the issue's example, then investigate the worker's ClassFactory.create_dynamic_model call under Ruby with concurrent-ruby 1.2.0 and no concurrent-ruby-ext. Reproduce the hang on Linux and establish why the worker does not finish; done means the supplied workload terminates without leaving wait_for_termination stuck.
由索引模型根据 Issue 内容生成。
描述
user_ids,org,delete_restore = get_org_and_user(delete_restore_id)
return unless user_ids.present?
work_num = [user_ids.length,50].min
thread_pool = Concurrent::FixedThreadPool.new(work_num)
error_map = Concurrent::Map.new
redis_key = RedisClient::DDRS_BULK_DELETE_KEY % org.id ## TODO
set_redis_total_num(redis_key,user_ids.length)
user_ids.each do |id|
thread_pool.post do
#delete_single_user(id,error_map,redis_key)
target_class = ClassFactory.create_dynamic_model("zendmodo", "privacy_settings", true)
puts id
puts target_class
end
end
thread_pool.shutdown
thread_pool.wait_for_termination
the wait_for_termination method will stuck the following code
target_class = ClassFactory.create_dynamic_model("zendmodo", "privacy_settings", true)
- Operating system: linux
- Ruby implementation: Ruby
concurrent-rubyversion: 1.2.0concurrent-ruby-extinstalled: noconcurrent-ruby-edgeused: no
- 主要语言
- Ruby
- 星标
- 5.8k
- 派生
- 420
- 平均合并
- 20 小时 45 分钟
- 30 天内合并 PR
- 4
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby-concurrency/concurrent-ruby 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
ruby-concurrency/concurrent-ruby#1118 ·
-
难度 4/5 3-5 天 新手友好度 35/100
ruby-concurrency/concurrent-ruby#1099 · 9 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
ruby-concurrency/concurrent-ruby#1095 · 8 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
ruby-concurrency/concurrent-ruby#1093 · 3 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 45/100
ruby-concurrency/concurrent-ruby#1091 ·
查看 ruby-concurrency/concurrent-ruby 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 88/100
-
バグ
难度 1/5 1 小时以内 新手友好度 92/100
-
难度 2/5 1-3 小时 新手友好度 75/100
voxpupuli/puppet-epel#186 · 1 条评论 ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) 未关闭Bug Frontend
难度 2/5 1-3 小时 新手友好度 78/100