From 96f10372dea471bfb0a950ccae0a1095adb788af Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 25 Jun 2026 01:06:03 -0400 Subject: [PATCH] feat(grpc): add RunRawQueryOnSession seam for handshake-reuse spike --- .../Grpc/HistorianGrpcReadOrchestrator.cs | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/AVEVA.Historian.Client/Grpc/HistorianGrpcReadOrchestrator.cs b/src/AVEVA.Historian.Client/Grpc/HistorianGrpcReadOrchestrator.cs index 74d0bad..d59d7bb 100644 --- a/src/AVEVA.Historian.Client/Grpc/HistorianGrpcReadOrchestrator.cs +++ b/src/AVEVA.Historian.Client/Grpc/HistorianGrpcReadOrchestrator.cs @@ -102,12 +102,28 @@ internal sealed class HistorianGrpcReadOrchestrator } } + // Spike/Phase-1 seam (pending.md A1): run a raw query against an EXTERNALLY-supplied, already- + // authenticated connection + client handle — i.e. NO Create()/handshake here. RunRawChain delegates + // to this so the per-call path and the reuse path share one query implementation (DRY). The handshake + // reuse-probe test drives this directly to measure whether the server honors a reused session. + internal List RunRawQueryOnSession( + HistorianGrpcConnection connection, + uint clientHandle, + string tag, + DateTime startUtc, + DateTime endUtc, + int maxValues, + CancellationToken cancellationToken) + { + HistorianDataQueryRequest request = HistorianWcfReadOrchestrator.BuildDataQueryRequest(tag, startUtc, endUtc, maxValues); + return RunQuery(connection, clientHandle, request, maxValues, cancellationToken); + } + private List RunRawChain(string tag, DateTime startUtc, DateTime endUtc, int maxValues, CancellationToken cancellationToken) { using HistorianGrpcConnection connection = HistorianGrpcChannelFactory.Create(_options); uint clientHandle = OpenAuthenticatedConnection(connection, cancellationToken); - HistorianDataQueryRequest request = HistorianWcfReadOrchestrator.BuildDataQueryRequest(tag, startUtc, endUtc, maxValues); - return RunQuery(connection, clientHandle, request, maxValues, cancellationToken); + return RunRawQueryOnSession(connection, clientHandle, tag, startUtc, endUtc, maxValues, cancellationToken); } private List RunAggregateChain(