Skip to content

fix: add error handling when use customized config #4342

Merged
spacewander merged 5 commits intoapache:masterfrom
Yiyiyimu:fix/custom-config-failure-handling
Jun 1, 2021
Merged

fix: add error handling when use customized config #4342
spacewander merged 5 commits intoapache:masterfrom
Yiyiyimu:fix/custom-config-failure-handling

Conversation

@Yiyiyimu
Copy link
Member

Signed-off-by: yiyiyimu wosoyoung@gmail.com

What this PR does / why we need it:

Ref: #4337

When implementing with #2101, no error handling is implemented so with the invalid config file, apisix would still start without the correct config setup. Here to fix it.

One thing to mention, since I failed to figure out how to get stderr separately when running shell command in Lua, considering normally stdout of ls and mv would always be empty (on ubuntu), I forward stderr to stdout to get the error msg and fail fast. Not sure if it's working in all OS.

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

Yiyiyimu added 3 commits May 30, 2021 21:28
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
Copy link
Member

@spacewander spacewander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failed.

Signed-off-by: yiyiyimu <wosoyoung@gmail.com>
@Yiyiyimu
Copy link
Member Author

@spacewander PTAL

@spacewander spacewander merged commit 98d4447 into apache:master Jun 1, 2021
@Yiyiyimu Yiyiyimu deleted the fix/custom-config-failure-handling branch June 1, 2021 01:41
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

Successfully merging this pull request may close these issues.

4 participants