Skip to content

Commit ce63d8d

Browse files
committed
docs: fix stale condition and orchestrator doc comments
1 parent ec9d49f commit ce63d8d

4 files changed

Lines changed: 33 additions & 39 deletions

File tree

libs/server-sdk/src/data_interfaces/source/ifdv2_condition.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ namespace launchdarkly::server_side::data_interfaces {
2727
* orchestrator builds a fresh condition for each synchronizer activation via
2828
* an IFDv2ConditionFactory.
2929
*
30-
* Close() cancels any pending internal work (e.g., a timer) without resolving
31-
* the future. After Close() returns the condition's future will not resolve.
30+
* Close() cancels any pending internal work (e.g., a timer) and resolves the
31+
* future with kCancelled.
3232
*
3333
* Implementations must be thread-safe: Execute, Inform, Close, and GetType
3434
* may be called from any thread.
@@ -58,8 +58,8 @@ class IFDv2Condition {
5858
virtual void Inform(FDv2SourceResult const& result) = 0;
5959

6060
/**
61-
* Cancels any pending internal work and ensures the future will not
62-
* resolve. Idempotent.
61+
* Cancels any pending internal work and resolves the future returned by
62+
* Execute() with kCancelled if it has not already resolved. Idempotent.
6363
*/
6464
virtual void Close() = 0;
6565

libs/server-sdk/src/data_systems/fdv2/conditions.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ class RecoveryConditionFactory final
138138
* underlying condition. If constructed with no conditions, GetFuture()
139139
* returns a Future that never resolves.
140140
*
141-
* Not thread-safe: the caller is responsible for serializing all method
142-
* calls.
141+
* Thread-safe: GetFuture, Inform, and Close may be called from any thread.
143142
*/
144143
class Conditions final {
145144
public:

libs/server-sdk/src/data_systems/fdv2/fdv2_data_system.cpp

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -314,38 +314,33 @@ void FDv2DataSystem::OnSynchronizerResult(
314314
bool got_shutdown = false;
315315
bool advance = false;
316316

317-
std::visit(
318-
overloaded{
319-
[&](Result::ChangeSet& cs) {
320-
ApplyChangeSet(std::move(cs.change_set));
321-
},
322-
[&](Result::Shutdown&) { got_shutdown = true; },
323-
[&](Result::Interrupted const& iv) {
324-
LD_LOG(logger_, LogLevel::kWarn)
325-
<< Identity()
326-
<< ": synchronizer interrupted: " << iv.error.Message();
327-
status_manager_->SetState(
328-
DataSourceStatus::DataSourceState::kInterrupted,
329-
iv.error.Kind(), iv.error.Message());
330-
},
331-
[&](Result::TerminalError const& te) {
332-
LD_LOG(logger_, LogLevel::kWarn)
333-
<< Identity()
334-
<< ": synchronizer terminal error: " << te.error.Message();
335-
status_manager_->SetState(
336-
DataSourceStatus::DataSourceState::kInterrupted,
337-
te.error.Kind(), te.error.Message());
338-
advance = true;
339-
},
340-
[&](Result::Goodbye const& gb) {
341-
// The synchronizer handles goodbye internally (reconnects);
342-
// the orchestrator just loops on the same source.
343-
LD_LOG(logger_, LogLevel::kDebug)
344-
<< Identity() << ": ignoring goodbye from synchronizer"
345-
<< (gb.reason ? ": " + *gb.reason : "");
346-
},
347-
},
348-
result.value);
317+
std::visit(overloaded{
318+
[&](Result::ChangeSet& cs) {
319+
ApplyChangeSet(std::move(cs.change_set));
320+
},
321+
[&](Result::Shutdown&) { got_shutdown = true; },
322+
[&](Result::Interrupted const& iv) {
323+
LD_LOG(logger_, LogLevel::kWarn)
324+
<< Identity() << ": synchronizer interrupted: "
325+
<< iv.error.Message();
326+
status_manager_->SetState(
327+
DataSourceStatus::DataSourceState::kInterrupted,
328+
iv.error.Kind(), iv.error.Message());
329+
},
330+
[&](Result::TerminalError const& te) {
331+
LD_LOG(logger_, LogLevel::kWarn)
332+
<< Identity() << ": synchronizer terminal error: "
333+
<< te.error.Message();
334+
status_manager_->SetState(
335+
DataSourceStatus::DataSourceState::kInterrupted,
336+
te.error.Kind(), te.error.Message());
337+
advance = true;
338+
},
339+
[&](Result::Goodbye const&) {
340+
// The synchronizer handles this internally.
341+
},
342+
},
343+
result.value);
349344

350345
{
351346
std::lock_guard<std::mutex> lock(mutex_);

libs/server-sdk/src/data_systems/fdv2/fdv2_data_system.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ namespace launchdarkly::server_side::data_systems {
9999
* | Initializer phase| ChangeSet(no selector) -> stay, N += 1
100100
* | N = 0, 1, 2, ... | ChangeSet(selector) -> go to Sync
101101
* | | Interrupted/Terminal -> stay, N += 1
102-
* | | Goodbye/Timeout -> stay, N += 1
102+
* | | Goodbye -> stay, N += 1
103103
* | | Shutdown -> [Closed]
104104
* +-------------------+
105105
* |

0 commit comments

Comments
 (0)