Skip to content

Commit

Permalink
[#2692] Addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fxdupont committed Mar 20, 2024
1 parent d855968 commit 70daa9a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
9 changes: 5 additions & 4 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
2209. [func] fdupont
Some hooks using multi-threading postpone their start
routing at the end of configuration processing.
Now these routines can safely throw when they detect
a problem: a configuration error is reported.
Some hooks using multi-threading postpone their startup until
after the configuration has been completed. If the hook
subsequently failed the startup, the error would not have been
properly propagated. The fix ensures that the errors are
reported during the configuration stage.
(Gitlab #2692)

Kea 2.5.6 (development) released on February 28, 2024
Expand Down
8 changes: 5 additions & 3 deletions src/bin/dhcp4/tests/callout_library_4.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// Copyright (C) 2018-2024 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2024 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

/// @file
/// @brief Callout library for testing execution of the dhcp4_srv_configured
/// hook point.
/// @brief Callout library for testing the scenarios when a hook library
/// posts some work to the IO service as a result of configuration.
/// Using a callout that always throws we can ensure that the server polls
/// this initial work before it starts working.
///
static const int LIBRARY_NUMBER = 4;

Expand Down
2 changes: 1 addition & 1 deletion src/bin/dhcp4/tests/hooks_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4040,7 +4040,7 @@ TEST_F(HooksDhcpv4SrvTest, lease4OfferDiscoverDecline) {
}

// Checks that postponed hook start service can fail.
TEST_F(LoadUnloadDhcpv4SrvTest, StartServiceFail) {
TEST_F(LoadUnloadDhcpv4SrvTest, startServiceFail) {
boost::shared_ptr<ControlledDhcpv4Srv> srv(new ControlledDhcpv4Srv(0));

// Ensure no marker files to start with.
Expand Down
8 changes: 5 additions & 3 deletions src/bin/dhcp6/tests/callout_library_4.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// Copyright (C) 2018-2024 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2024 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

/// @file
/// @brief Callout library for testing execution of the dhcp6_srv_configured
/// hook point.
/// @brief Callout library for testing the scenarios when a hook library
/// posts some work to the IO service as a result of configuration.
/// Using a callout that always throws we can ensure that the server polls
/// this initial work before it starts working.
///
static const int LIBRARY_NUMBER = 4;

Expand Down
2 changes: 1 addition & 1 deletion src/bin/dhcp6/tests/hooks_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5834,7 +5834,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6ParkedPacketLimit) {
}

// Checks that postponed hook start service can fail.
TEST_F(LoadUnloadDhcpv6SrvTest, StartServiceFail) {
TEST_F(LoadUnloadDhcpv6SrvTest, startServiceFail) {
boost::shared_ptr<ControlledDhcpv6Srv> srv(new ControlledDhcpv6Srv(0));

// Ensure no marker files to start with.
Expand Down

0 comments on commit 70daa9a

Please sign in to comment.