dnsdist: add opt-in fatal bind failures for console and webserver#17099
dnsdist: add opt-in fatal bind failures for console and webserver#17099Annih wants to merge 1 commit into
Conversation
64d598b to
274ff6d
Compare
|
OK after fixing the python indentation issues (in 3 takes) I just noticed I forgot the mention Also note that in the doc I added
Finally, I also struggled on the case of the webserver setting, I settled on |
|
Humpf I need to understand why my simple tests are working locally but not on the CI 🤔will see later this week :( |
|
At a quick glance the code looks very nice, thanks! Let me know if you want me to have a look at the test failures! |
|
@rgacogne I didn't find the time yet to get back to it to fix test, if you have time soon-ish please have a look, my setup to rebuild/repro is not perfect. (it currently works on my machine ... ^^') |
|
I can reproduce locally, the problem is that the regression tests check the exit status of |
|
This fixes the issue for me: diff --git regression-tests.dnsdist/test_BindFatal.py regression-tests.dnsdist/test_BindFatal.py
index 11282c896b..b5e0379708 100644
--- regression-tests.dnsdist/test_BindFatal.py
+++ regression-tests.dnsdist/test_BindFatal.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
import unittest
+import time
from dnsdisttests import DNSDistTest
@@ -17,6 +18,11 @@ class _BindFatalMixin:
cls._startupFailed = False
try:
super().setUpClass()
+ for _ in range(0, 20):
+ if cls._dnsdist.poll() is not None:
+ cls._startupFailed = True
+ break
+ time.sleep(0.1)
except unittest.SkipTest:
raise
except Exception: |
|
Hi! Do you mind if a push the fix I mentioned earlier to your branch? |
274ff6d to
138e88d
Compare
|
Hello @rgacogne , thanks for checking and your proposal to amend my commit; I was a bit busy on other topics, and our dnsdist usecase was a bit in pause. For instance I refere to version 2.2.0, should I be the one to add that? should I remove it? |
138e88d to
c2f260d
Compare
|
I rebased your PR on the current main branch to fix a conflict |
Looks good to me, thanks! Let's see if CI is happy with it :)
No, what you did is exactly what was needed, no worries. |
Coverage Report for CI Build 26601352724Coverage increased (+4.1%) to 71.072%Details
Uncovered Changes
Coverage Regressions40 previously-covered lines in 8 files lost coverage.
Coverage Stats💛 - Coveralls |
pieterlexis
left a comment
There was a problem hiding this comment.
Nice, good stuff. 2 small documentation nits.
Introduce opt-in fatal behavior when binding the webserver socket or the control socket fails, to make startup failures visible to service managers like systemd. Expose the feature in both configuration styles: - Lua: setConsoleBindFatal(bool), setWebserverBindFatal(bool) - YAML: console.bind_fatal, webserver.bind_fatal When enabled, dnsdist now exits with failure on bind exceptions for: - control socket listeners - webserver listeners Wire the new settings through runtime configuration loading, Lua configuration items, and YAML parsing, and add console completion entries for both setters. Update documentation with new config functions and behavior notes. Add regression tests in test_BindFatal.py for Lua and YAML, validating: - default/not set: bind failures are non-fatal - explicit false: bind failures are non-fatal - explicit true: bind failures are fatal at startup Signed-off-by: b.courtois <b.courtois@criteo.com>
c2f260d to
a37aaaf
Compare
Short description
Introduce opt-in fatal behavior when binding the webserver socket or the control socket fails, to make startup failures visible to service managers like systemd.
Expose the feature in both configuration styles:
When enabled, dnsdist now exits with failure on bind exceptions for:
Wire the new settings through runtime configuration loading, Lua configuration items, and YAML parsing, and add console completion entries for both setters.
Update documentation with new config functions and behavior notes.
Add regression tests in test_BindFatal.py for Lua and YAML, validating:
This should solve #17036
Checklist
I have: