Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongodb挂了会影响cronnode任务的调度运行? #182

Open
zjmood opened this issue Nov 11, 2020 · 2 comments
Open

mongodb挂了会影响cronnode任务的调度运行? #182

zjmood opened this issue Nov 11, 2020 · 2 comments

Comments

@zjmood
Copy link

zjmood commented Nov 11, 2020

Please answer these questions before submitting your issue. Thanks!
在你提交 issue 前,请先回答以下问题,谢谢!

  1. What version of Go and cronsun version are you using?
    你用的是哪个版本的 Go 和 哪个版本的 cronsun?
    cronsun-v0.3.2 直接下载的release包

  2. What operating system and processor architecture are you using (go env)?
    你用的是哪个操作系统,什么架构的?
    CentOS release 6.7

  3. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.
    你做了什么,遇到了什么问题?尽可能描述清楚问题,最好把操作步骤写下来,按这些步骤操作后能重现你的问题。

mongodb挂了,cronnode结点所在的任务不执行,完全没有调度,
从可靠性说明文档来看即使mongodb挂了只是影响日志的记录,不会影响任务的运行,
cronnode日志报错日志如下:
2020-11-10T19:09:17.796+0800 ERROR node/server.go:37 Connect to MongoDB [mongodb://test:test@mongo1:27017,test:test@mongo2:27017,test:test@mongo3:27017/cronsun?authSource=admin] failed: no reachable servers
github.com/shunfei/cronsun/log.Errorf
/Users/Doflatango/go/src/github.com/shunfei/cronsun/log/log.go:39
main.main
/Users/Doflatango/go/src/github.com/shunfei/cronsun/bin/node/server.go:37
runtime.main
/usr/local/go/src/runtime/proc.go:198

  1. What did you expect to see?
    你期望得到什么样的结果?
    mongodb挂了不影响任务的运行,只是影响日志记录

  2. What did you see instead?
    现在你得到的结果是什么样的?
    mongodb挂了cronnode所在的结点任务不会调度执行,@QLeelulu

@zjmood zjmood changed the title mongodb挂了会影响cronnode的运行? mongodb挂了会影响cronnode任务的调度运行? Nov 11, 2020
@penwyp
Copy link

penwyp commented Dec 15, 2020

node执行过程中,如果mongodb挂了,任务可以继续执行,只是不能记录日志;
但是你这里是启动时尝试连接mongodb时报错,我觉得是合理的;

如果觉得这是可以容忍的,那么可以common.go文件,做兼容

@yewenhai99999
Copy link

我测试,每分钟执行单机单进程任务,mongodb挂了后,这个任务成功一次,失败一次,以此循环

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants