refactor(r2-02): remove bulkhead fields from the resilience form (01/U-6)
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
{ "id": 8, "subject": "S-8/P-4 invoker: cache the no-retry options snapshot once per invoker + add RecordCallStart/Complete tracker accounting to the non-idempotent arm + 2 CapabilityInvokerTests", "status": "completed", "blockedBy": [7] },
|
||||
{ "id": 9, "subject": "S-8 docs + form: fix WriteIdempotentAttribute's false 'reads via reflection' claim; note the non-idempotent production default; disable Write/Ack retry cells in the razor", "status": "completed", "blockedBy": [7, 5] },
|
||||
{ "id": 10, "subject": "U-6 delete (Core): remove BulkheadMaxConcurrent/MaxQueue from DriverResilienceOptions + parser shape/merge/doc-example; add BulkheadKeys_InStoredJson_AreIgnored (migration-free contract)", "status": "completed", "blockedBy": [2, 6] },
|
||||
{ "id": 11, "subject": "U-6 delete (AdminUI): strip bulkhead fields from ResilienceFormModel + the two razor inputs; update ResilienceFormModelTests", "status": "pending", "blockedBy": [5, 10] },
|
||||
{ "id": 11, "subject": "U-6 delete (AdminUI): strip bulkhead fields from ResilienceFormModel + the two razor inputs; update ResilienceFormModelTests", "status": "completed", "blockedBy": [5, 10] },
|
||||
{ "id": 12, "subject": "U-6 doc sweep (seam xmldocs, OTOPCUA0001 message + analyzer tests, operator docs; leave migrations/WedgeDetector/historical plans) + Options_properties_are_exactly_the_pipeline_wired_set knob-inertness guard", "status": "pending", "blockedBy": [10, 11] },
|
||||
{ "id": 13, "subject": "C-7 RED tests: unknown top-level key / unknown capability / unknown per-policy field survive round-trip; malformed JSON sets ParseFailed and ToJson returns the original text", "status": "pending", "blockedBy": [11] },
|
||||
{ "id": 14, "subject": "C-7 implement: JsonObject-bag FromJson/ToJson (TagConfigJson idiom), ParseFailed + RawStoredJson, blank->null contract preserved, parser-interop test green", "status": "pending", "blockedBy": [13] },
|
||||
|
||||
-4
@@ -7,10 +7,6 @@
|
||||
(see <span class="mono">docs/v2/driver-stability.md</span>). Set only what you need to override.</p>
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-4"><label class="form-label">Bulkhead max concurrent</label>
|
||||
<input type="number" class="form-control form-control-sm" @bind="_m.BulkheadMaxConcurrent" @bind:after="EmitAsync" placeholder="tier default" /></div>
|
||||
<div class="col-md-4"><label class="form-label">Bulkhead max queue</label>
|
||||
<input type="number" class="form-control form-control-sm" @bind="_m.BulkheadMaxQueue" @bind:after="EmitAsync" placeholder="tier default" /></div>
|
||||
<div class="col-md-4"><label class="form-label">Recycle interval (s, Tier C only)</label>
|
||||
<input type="number" class="form-control form-control-sm" @bind="_m.RecycleIntervalSeconds" @bind:after="EmitAsync" placeholder="none" /></div>
|
||||
</div>
|
||||
|
||||
+1
-14
@@ -15,10 +15,6 @@ public sealed class ResilienceFormModel
|
||||
public static readonly string[] Capabilities =
|
||||
["Read", "Write", "Discover", "Subscribe", "Probe", "AlarmSubscribe", "AlarmAcknowledge", "HistoryRead"];
|
||||
|
||||
/// <summary>Gets or sets the bulkhead max-concurrency override; null = use the tier default.</summary>
|
||||
public int? BulkheadMaxConcurrent { get; set; }
|
||||
/// <summary>Gets or sets the bulkhead max-queue-length override; null = use the tier default.</summary>
|
||||
public int? BulkheadMaxQueue { get; set; }
|
||||
/// <summary>Gets or sets the driver recycle-interval override, in seconds; null = use the tier default.</summary>
|
||||
public int? RecycleIntervalSeconds { get; set; }
|
||||
|
||||
@@ -92,8 +88,6 @@ public sealed class ResilienceFormModel
|
||||
catch (JsonException) { return model; } // malformed -> empty form; raw view (next task) shows the text
|
||||
if (shape is null) return model;
|
||||
|
||||
model.BulkheadMaxConcurrent = shape.BulkheadMaxConcurrent;
|
||||
model.BulkheadMaxQueue = shape.BulkheadMaxQueue;
|
||||
model.RecycleIntervalSeconds = shape.RecycleIntervalSeconds;
|
||||
if (shape.CapabilityPolicies is not null)
|
||||
foreach (var (cap, p) in shape.CapabilityPolicies)
|
||||
@@ -119,14 +113,11 @@ public sealed class ResilienceFormModel
|
||||
BreakerFailureThreshold = kv.Value.BreakerFailureThreshold,
|
||||
});
|
||||
|
||||
var hasAny = BulkheadMaxConcurrent is not null || BulkheadMaxQueue is not null
|
||||
|| RecycleIntervalSeconds is not null || caps.Count > 0;
|
||||
var hasAny = RecycleIntervalSeconds is not null || caps.Count > 0;
|
||||
if (!hasAny) return null;
|
||||
|
||||
var shape = new Shape
|
||||
{
|
||||
BulkheadMaxConcurrent = BulkheadMaxConcurrent,
|
||||
BulkheadMaxQueue = BulkheadMaxQueue,
|
||||
RecycleIntervalSeconds = RecycleIntervalSeconds,
|
||||
CapabilityPolicies = caps.Count > 0 ? caps : null,
|
||||
};
|
||||
@@ -136,10 +127,6 @@ public sealed class ResilienceFormModel
|
||||
/// <summary>Wire shape of the resilience-override JSON, as consumed by DriverResilienceOptionsParser.</summary>
|
||||
private sealed class Shape
|
||||
{
|
||||
/// <summary>Gets or sets the bulkhead max-concurrency override.</summary>
|
||||
public int? BulkheadMaxConcurrent { get; set; }
|
||||
/// <summary>Gets or sets the bulkhead max-queue-length override.</summary>
|
||||
public int? BulkheadMaxQueue { get; set; }
|
||||
/// <summary>Gets or sets the driver recycle-interval override, in seconds.</summary>
|
||||
public int? RecycleIntervalSeconds { get; set; }
|
||||
/// <summary>Gets or sets the per-capability overrides, keyed by capability name.</summary>
|
||||
|
||||
@@ -13,7 +13,7 @@ public class ResilienceFormModelTests
|
||||
[Fact]
|
||||
public void Partial_override_round_trips()
|
||||
{
|
||||
var m = new ResilienceFormModel { BulkheadMaxConcurrent = 16 };
|
||||
var m = new ResilienceFormModel { RecycleIntervalSeconds = 3600 };
|
||||
m.Policies["Read"].TimeoutSeconds = 5;
|
||||
m.Policies["Read"].RetryCount = 5;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ResilienceFormModelTests
|
||||
json.ShouldNotBeNull();
|
||||
|
||||
var back = ResilienceFormModel.FromJson(json);
|
||||
back.BulkheadMaxConcurrent.ShouldBe(16);
|
||||
back.RecycleIntervalSeconds.ShouldBe(3600);
|
||||
back.Policies["Read"].TimeoutSeconds.ShouldBe(5);
|
||||
back.Policies["Write"].IsEmpty.ShouldBeTrue();
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public class ResilienceFormModelTests
|
||||
public void Malformed_json_yields_empty_model()
|
||||
{
|
||||
var m = ResilienceFormModel.FromJson("{ not valid json");
|
||||
m.BulkheadMaxConcurrent.ShouldBeNull();
|
||||
m.RecycleIntervalSeconds.ShouldBeNull();
|
||||
m.Policies["Read"].IsEmpty.ShouldBeTrue();
|
||||
}
|
||||
|
||||
@@ -67,12 +67,11 @@ public class ResilienceFormModelTests
|
||||
[Fact]
|
||||
public void Emitted_json_is_consumable_by_the_runtime_parser()
|
||||
{
|
||||
var m = new ResilienceFormModel { BulkheadMaxConcurrent = 16 };
|
||||
var m = new ResilienceFormModel();
|
||||
m.Policies["Read"].TimeoutSeconds = 7;
|
||||
|
||||
var opts = DriverResilienceOptionsParser.ParseOrDefaults(DriverTier.B, m.ToJson(), out var diag);
|
||||
diag.ShouldBeNull();
|
||||
opts.BulkheadMaxConcurrent.ShouldBe(16);
|
||||
opts.Resolve(DriverCapability.Read).TimeoutSeconds.ShouldBe(7);
|
||||
opts.Resolve(DriverCapability.Write).RetryCount.ShouldBe(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user