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

master进程启动失败,但worker进程启动正常 #415

Open
jimchou800 opened this issue Jun 3, 2020 · 0 comments
Open

master进程启动失败,但worker进程启动正常 #415

jimchou800 opened this issue Jun 3, 2020 · 0 comments

Comments

@jimchou800
Copy link

jimchou800 commented Jun 3, 2020

使用的Orange版本

如v0.8.1

需求或场景
function Orange.init(options)
    options = options or {}
    local store, config
    local status, err = pcall(function()
        local conf_file_path = options.config
        config = config_loader.load(conf_file_path)
        store = require("orange.store.mysql_store")(config.store_mysql)

        loaded_plugins = load_node_plugins(config, store)
        ngx.update_time()
        config.orange_start_at = ngx.now()
    end)

    if not status or err then
        ngx.log(ngx.ERR, "Startup error: " .. err)
        os.exit(1)
    end

    Orange.data = {
        store = store,
        config = config,
    }

    -- init dns_client
    assert(dns_client.init())

    return config, store
end

启动失败则os.exit(1)这里只退出了master进程,worker进程其实还是在运行,导致orange start 和 reload都启动不了,只有把worker进程kill掉

    if not status or err then
        ngx.log(ngx.ERR, "Startup error: " .. err)
        os.exit(1)
    end
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

1 participant