backgroundrb thread_pool.defer 方法记录器输出到哪里?
似乎由于线程问题 logger.warn (这就是我测试的)不会生成任何输出? 我的代码与此类似:
def deliver(args)
logger.info "delivery start"
thread_pool.defer(:deliver_deferred, args)
logger.info "delivery end"
end
def deliver_deferred(args)
logger.warn "whatsoever"
end
有什么想法吗?
It seems like due to the threading issue logger.warn (thats what I tested) doesn't generate any output? my code is similar to this:
def deliver(args)
logger.info "delivery start"
thread_pool.defer(:deliver_deferred, args)
logger.info "delivery end"
end
def deliver_deferred(args)
logger.warn "whatsoever"
end
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定具体细节,但假设 BackgrounDRb 作为分叉进程运行,任何打开的文件都将针对分叉子进程关闭。 这可能会像您所看到的那样显现出来。
然而,我认为 BackgrounDRb 会足够聪明来处理这个问题,因为它应该是一个非常明显的问题。
I'm not sure about the specifics, but assuming BackgrounDRb runs as a forked process, any open files would be closed for the forked child process. This would likely manifest itself as what you're seeing.
However, I would've assumed that BackgrounDRb would've been smart enough to handle that, since it ought to be a pretty obvious issue.