Skip to content

Commit

Permalink
Merge !1653: manager: delayed policy-loader exit
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Feb 4, 2025
2 parents db1fe2a + 5c5d1f7 commit 56e40d3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
9 changes: 9 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Knot Resolver 6.0.11 (2025-0m-dd)
=================================

Bugfixes
--------
- manager: avoid an uncommon startup race in policy-loader (!1653)
[WARN] exited: policy-loader (exit status 0; not expected)


Knot Resolver 6.0.10 (2025-01-20)
=================================

Expand Down
2 changes: 2 additions & 0 deletions daemon/lua/kres-gen-33.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ struct timeval {
__suseconds_t tv_usec;
};

unsigned sleep(unsigned seconds);

typedef struct knot_dump_style knot_dump_style_t;
extern const knot_dump_style_t KR_DUMP_STYLE_DEFAULT;
struct kr_cdb_api {};
Expand Down
4 changes: 4 additions & 0 deletions daemon/lua/kres-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ struct timeval {
__suseconds_t tv_usec;
};
"
# We use this in policy-loader
printf "
unsigned sleep(unsigned seconds);
"

## Various types (mainly), from libknot and libkres

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ cache.open({{ cfg.cache.size_max.bytes() }}, 'lmdb://{{ cfg.cache.storage }}')
{% set disable_defer = true %}
{% include "defer.lua.j2" %}


{% endif %}

-- This sleep() is necessary because of the possible
-- termination of the policy-loader before it is
-- added into starting_processes in sd_notify.py.
-- If this happens, the READY notification will end with an error.
C.sleep(1)

-- exit policy-loader properly
quit()

0 comments on commit 56e40d3

Please sign in to comment.