@adaptic/backend-legacy 0.0.960 → 0.0.962
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ABTest.cjs +180 -66
- package/Account.cjs +180 -66
- package/AccountDecisionRecord.cjs +180 -66
- package/AccountLinkingRequest.cjs +180 -66
- package/Action.cjs +180 -66
- package/Alert.cjs +180 -66
- package/Allocation.cjs +180 -66
- package/AlpacaAccount.cjs +180 -66
- package/AnalyticsConfiguration.cjs +180 -66
- package/AnalyticsSnapshot.cjs +180 -66
- package/Asset.cjs +180 -66
- package/AuditLog.cjs +180 -66
- package/Authenticator.cjs +180 -66
- package/Configuration.cjs +180 -66
- package/ConflictEvent.cjs +180 -66
- package/ConnectionHealthSnapshot.cjs +180 -66
- package/Customer.cjs +180 -66
- package/DeadLetterMessage.cjs +180 -66
- package/DecisionMemorySummary.cjs +180 -66
- package/EconomicEvent.cjs +180 -66
- package/EquityBar.cjs +180 -66
- package/Event.cjs +180 -66
- package/EventSnapshot.cjs +180 -66
- package/FeatureImportanceAnalysis.cjs +180 -66
- package/InstitutionalFlowSignal.cjs +180 -66
- package/InstitutionalHolding.cjs +180 -66
- package/InstitutionalSentimentAlerts.cjs +180 -66
- package/InstitutionalSentimentErrors.cjs +180 -66
- package/InstitutionalSentimentHistory.cjs +180 -66
- package/InstitutionalSentimentMetrics.cjs +180 -66
- package/InviteToken.cjs +180 -66
- package/LinkedProvider.cjs +180 -66
- package/LlmConfiguration.cjs +180 -66
- package/MLModelVersion.cjs +180 -66
- package/MLTrainingData.cjs +180 -66
- package/MarketSentiment.cjs +180 -66
- package/ModelArtifact.cjs +180 -66
- package/ModelVersion.cjs +180 -66
- package/ModelVersionArtifact.cjs +180 -66
- package/NewsArticle.cjs +180 -66
- package/NewsArticleAssetSentiment.cjs +180 -66
- package/OptionsContract.cjs +180 -66
- package/OptionsGreeksHistory.cjs +180 -66
- package/OptionsPosition.cjs +180 -66
- package/OptionsPositionEvent.cjs +180 -66
- package/OptionsTradeExecution.cjs +180 -66
- package/PolicyOverlay.cjs +180 -66
- package/PortfolioGreeksHistory.cjs +180 -66
- package/ScheduledOptionOrder.cjs +180 -66
- package/Session.cjs +180 -66
- package/SignalGeneratorMetrics.cjs +180 -66
- package/SignalLineage.cjs +180 -66
- package/SignalOutcome.cjs +180 -66
- package/SignalPriorityQueue.cjs +180 -66
- package/SyncEvent.cjs +180 -66
- package/SystemAlert.cjs +180 -66
- package/Trade.cjs +180 -66
- package/TradeAuditEvent.cjs +180 -66
- package/TradeExecutionHistory.cjs +180 -66
- package/TradeOutcome.cjs +180 -66
- package/TradingPolicy.cjs +180 -66
- package/User.cjs +180 -66
- package/VerificationToken.cjs +180 -66
- package/WaitlistEntry.cjs +180 -66
- package/client.cjs +131 -9
- package/client.d.ts +32 -0
- package/esm/ABTest.d.ts.map +1 -1
- package/esm/ABTest.js.map +1 -1
- package/esm/ABTest.mjs +180 -66
- package/esm/Account.d.ts.map +1 -1
- package/esm/Account.js.map +1 -1
- package/esm/Account.mjs +180 -66
- package/esm/AccountDecisionRecord.d.ts.map +1 -1
- package/esm/AccountDecisionRecord.js.map +1 -1
- package/esm/AccountDecisionRecord.mjs +180 -66
- package/esm/AccountLinkingRequest.d.ts.map +1 -1
- package/esm/AccountLinkingRequest.js.map +1 -1
- package/esm/AccountLinkingRequest.mjs +180 -66
- package/esm/Action.d.ts.map +1 -1
- package/esm/Action.js.map +1 -1
- package/esm/Action.mjs +180 -66
- package/esm/Alert.d.ts.map +1 -1
- package/esm/Alert.js.map +1 -1
- package/esm/Alert.mjs +180 -66
- package/esm/Allocation.d.ts.map +1 -1
- package/esm/Allocation.js.map +1 -1
- package/esm/Allocation.mjs +180 -66
- package/esm/AlpacaAccount.d.ts.map +1 -1
- package/esm/AlpacaAccount.js.map +1 -1
- package/esm/AlpacaAccount.mjs +180 -66
- package/esm/AnalyticsConfiguration.d.ts.map +1 -1
- package/esm/AnalyticsConfiguration.js.map +1 -1
- package/esm/AnalyticsConfiguration.mjs +180 -66
- package/esm/AnalyticsSnapshot.d.ts.map +1 -1
- package/esm/AnalyticsSnapshot.js.map +1 -1
- package/esm/AnalyticsSnapshot.mjs +180 -66
- package/esm/Asset.d.ts.map +1 -1
- package/esm/Asset.js.map +1 -1
- package/esm/Asset.mjs +180 -66
- package/esm/AuditLog.d.ts.map +1 -1
- package/esm/AuditLog.js.map +1 -1
- package/esm/AuditLog.mjs +180 -66
- package/esm/Authenticator.d.ts.map +1 -1
- package/esm/Authenticator.js.map +1 -1
- package/esm/Authenticator.mjs +180 -66
- package/esm/Configuration.d.ts.map +1 -1
- package/esm/Configuration.js.map +1 -1
- package/esm/Configuration.mjs +180 -66
- package/esm/ConflictEvent.d.ts.map +1 -1
- package/esm/ConflictEvent.js.map +1 -1
- package/esm/ConflictEvent.mjs +180 -66
- package/esm/ConnectionHealthSnapshot.d.ts.map +1 -1
- package/esm/ConnectionHealthSnapshot.js.map +1 -1
- package/esm/ConnectionHealthSnapshot.mjs +180 -66
- package/esm/Customer.d.ts.map +1 -1
- package/esm/Customer.js.map +1 -1
- package/esm/Customer.mjs +180 -66
- package/esm/DeadLetterMessage.d.ts.map +1 -1
- package/esm/DeadLetterMessage.js.map +1 -1
- package/esm/DeadLetterMessage.mjs +180 -66
- package/esm/DecisionMemorySummary.d.ts.map +1 -1
- package/esm/DecisionMemorySummary.js.map +1 -1
- package/esm/DecisionMemorySummary.mjs +180 -66
- package/esm/EconomicEvent.d.ts.map +1 -1
- package/esm/EconomicEvent.js.map +1 -1
- package/esm/EconomicEvent.mjs +180 -66
- package/esm/EquityBar.d.ts.map +1 -1
- package/esm/EquityBar.js.map +1 -1
- package/esm/EquityBar.mjs +180 -66
- package/esm/Event.d.ts.map +1 -1
- package/esm/Event.js.map +1 -1
- package/esm/Event.mjs +180 -66
- package/esm/EventSnapshot.d.ts.map +1 -1
- package/esm/EventSnapshot.js.map +1 -1
- package/esm/EventSnapshot.mjs +180 -66
- package/esm/FeatureImportanceAnalysis.d.ts.map +1 -1
- package/esm/FeatureImportanceAnalysis.js.map +1 -1
- package/esm/FeatureImportanceAnalysis.mjs +180 -66
- package/esm/InstitutionalFlowSignal.d.ts.map +1 -1
- package/esm/InstitutionalFlowSignal.js.map +1 -1
- package/esm/InstitutionalFlowSignal.mjs +180 -66
- package/esm/InstitutionalHolding.d.ts.map +1 -1
- package/esm/InstitutionalHolding.js.map +1 -1
- package/esm/InstitutionalHolding.mjs +180 -66
- package/esm/InstitutionalSentimentAlerts.d.ts.map +1 -1
- package/esm/InstitutionalSentimentAlerts.js.map +1 -1
- package/esm/InstitutionalSentimentAlerts.mjs +180 -66
- package/esm/InstitutionalSentimentErrors.d.ts.map +1 -1
- package/esm/InstitutionalSentimentErrors.js.map +1 -1
- package/esm/InstitutionalSentimentErrors.mjs +180 -66
- package/esm/InstitutionalSentimentHistory.d.ts.map +1 -1
- package/esm/InstitutionalSentimentHistory.js.map +1 -1
- package/esm/InstitutionalSentimentHistory.mjs +180 -66
- package/esm/InstitutionalSentimentMetrics.d.ts.map +1 -1
- package/esm/InstitutionalSentimentMetrics.js.map +1 -1
- package/esm/InstitutionalSentimentMetrics.mjs +180 -66
- package/esm/InviteToken.d.ts.map +1 -1
- package/esm/InviteToken.js.map +1 -1
- package/esm/InviteToken.mjs +180 -66
- package/esm/LinkedProvider.d.ts.map +1 -1
- package/esm/LinkedProvider.js.map +1 -1
- package/esm/LinkedProvider.mjs +180 -66
- package/esm/LlmConfiguration.d.ts.map +1 -1
- package/esm/LlmConfiguration.js.map +1 -1
- package/esm/LlmConfiguration.mjs +180 -66
- package/esm/MLModelVersion.d.ts.map +1 -1
- package/esm/MLModelVersion.js.map +1 -1
- package/esm/MLModelVersion.mjs +180 -66
- package/esm/MLTrainingData.d.ts.map +1 -1
- package/esm/MLTrainingData.js.map +1 -1
- package/esm/MLTrainingData.mjs +180 -66
- package/esm/MarketSentiment.d.ts.map +1 -1
- package/esm/MarketSentiment.js.map +1 -1
- package/esm/MarketSentiment.mjs +180 -66
- package/esm/ModelArtifact.d.ts.map +1 -1
- package/esm/ModelArtifact.js.map +1 -1
- package/esm/ModelArtifact.mjs +180 -66
- package/esm/ModelVersion.d.ts.map +1 -1
- package/esm/ModelVersion.js.map +1 -1
- package/esm/ModelVersion.mjs +180 -66
- package/esm/ModelVersionArtifact.d.ts.map +1 -1
- package/esm/ModelVersionArtifact.js.map +1 -1
- package/esm/ModelVersionArtifact.mjs +180 -66
- package/esm/NewsArticle.d.ts.map +1 -1
- package/esm/NewsArticle.js.map +1 -1
- package/esm/NewsArticle.mjs +180 -66
- package/esm/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/esm/NewsArticleAssetSentiment.js.map +1 -1
- package/esm/NewsArticleAssetSentiment.mjs +180 -66
- package/esm/OptionsContract.d.ts.map +1 -1
- package/esm/OptionsContract.js.map +1 -1
- package/esm/OptionsContract.mjs +180 -66
- package/esm/OptionsGreeksHistory.d.ts.map +1 -1
- package/esm/OptionsGreeksHistory.js.map +1 -1
- package/esm/OptionsGreeksHistory.mjs +180 -66
- package/esm/OptionsPosition.d.ts.map +1 -1
- package/esm/OptionsPosition.js.map +1 -1
- package/esm/OptionsPosition.mjs +180 -66
- package/esm/OptionsPositionEvent.d.ts.map +1 -1
- package/esm/OptionsPositionEvent.js.map +1 -1
- package/esm/OptionsPositionEvent.mjs +180 -66
- package/esm/OptionsTradeExecution.d.ts.map +1 -1
- package/esm/OptionsTradeExecution.js.map +1 -1
- package/esm/OptionsTradeExecution.mjs +180 -66
- package/esm/PolicyOverlay.d.ts.map +1 -1
- package/esm/PolicyOverlay.js.map +1 -1
- package/esm/PolicyOverlay.mjs +180 -66
- package/esm/PortfolioGreeksHistory.d.ts.map +1 -1
- package/esm/PortfolioGreeksHistory.js.map +1 -1
- package/esm/PortfolioGreeksHistory.mjs +180 -66
- package/esm/ScheduledOptionOrder.d.ts.map +1 -1
- package/esm/ScheduledOptionOrder.js.map +1 -1
- package/esm/ScheduledOptionOrder.mjs +180 -66
- package/esm/Session.d.ts.map +1 -1
- package/esm/Session.js.map +1 -1
- package/esm/Session.mjs +180 -66
- package/esm/SignalGeneratorMetrics.d.ts.map +1 -1
- package/esm/SignalGeneratorMetrics.js.map +1 -1
- package/esm/SignalGeneratorMetrics.mjs +180 -66
- package/esm/SignalLineage.d.ts.map +1 -1
- package/esm/SignalLineage.js.map +1 -1
- package/esm/SignalLineage.mjs +180 -66
- package/esm/SignalOutcome.d.ts.map +1 -1
- package/esm/SignalOutcome.js.map +1 -1
- package/esm/SignalOutcome.mjs +180 -66
- package/esm/SignalPriorityQueue.d.ts.map +1 -1
- package/esm/SignalPriorityQueue.js.map +1 -1
- package/esm/SignalPriorityQueue.mjs +180 -66
- package/esm/SyncEvent.d.ts.map +1 -1
- package/esm/SyncEvent.js.map +1 -1
- package/esm/SyncEvent.mjs +180 -66
- package/esm/SystemAlert.d.ts.map +1 -1
- package/esm/SystemAlert.js.map +1 -1
- package/esm/SystemAlert.mjs +180 -66
- package/esm/Trade.d.ts.map +1 -1
- package/esm/Trade.js.map +1 -1
- package/esm/Trade.mjs +180 -66
- package/esm/TradeAuditEvent.d.ts.map +1 -1
- package/esm/TradeAuditEvent.js.map +1 -1
- package/esm/TradeAuditEvent.mjs +180 -66
- package/esm/TradeExecutionHistory.d.ts.map +1 -1
- package/esm/TradeExecutionHistory.js.map +1 -1
- package/esm/TradeExecutionHistory.mjs +180 -66
- package/esm/TradeOutcome.d.ts.map +1 -1
- package/esm/TradeOutcome.js.map +1 -1
- package/esm/TradeOutcome.mjs +180 -66
- package/esm/TradingPolicy.d.ts.map +1 -1
- package/esm/TradingPolicy.js.map +1 -1
- package/esm/TradingPolicy.mjs +180 -66
- package/esm/User.d.ts.map +1 -1
- package/esm/User.js.map +1 -1
- package/esm/User.mjs +180 -66
- package/esm/VerificationToken.d.ts.map +1 -1
- package/esm/VerificationToken.js.map +1 -1
- package/esm/VerificationToken.mjs +180 -66
- package/esm/WaitlistEntry.d.ts.map +1 -1
- package/esm/WaitlistEntry.js.map +1 -1
- package/esm/WaitlistEntry.mjs +180 -66
- package/esm/client.d.ts +32 -0
- package/esm/client.d.ts.map +1 -1
- package/esm/client.js.map +1 -1
- package/esm/client.mjs +130 -9
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/index.mjs +1 -1
- package/index.cjs +2 -1
- package/index.d.ts +2 -2
- package/package.json +1 -1
package/esm/client.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// client.ts
|
|
2
|
+
import { randomInt } from 'node:crypto';
|
|
2
3
|
import { logger } from './utils/logger.mjs';
|
|
3
4
|
const DEFAULT_POOL_CONFIG = {
|
|
4
5
|
maxConcurrentOperations: 100, // Maximum concurrent operations to the database
|
|
@@ -15,6 +16,18 @@ let pendingOperations = 0;
|
|
|
15
16
|
const operationQueue = [];
|
|
16
17
|
let poolConfig = DEFAULT_POOL_CONFIG;
|
|
17
18
|
let customTokenProvider;
|
|
19
|
+
// === Pool observability counters ===
|
|
20
|
+
// These are best-effort process-local counters. They are exposed via
|
|
21
|
+
// `getPoolStats()` for engine-side Prometheus scraping. Resetting
|
|
22
|
+
// categorical counters is not offered — callers that care about deltas
|
|
23
|
+
// should sample-then-diff.
|
|
24
|
+
const poolCounters = {
|
|
25
|
+
executedTotal: 0,
|
|
26
|
+
rejectedLoadShed: 0,
|
|
27
|
+
rejectedQueueWaitTimeout: 0,
|
|
28
|
+
rejectedNonRetryable: 0,
|
|
29
|
+
retryAttemptsTotal: 0,
|
|
30
|
+
};
|
|
18
31
|
/**
|
|
19
32
|
* Dynamically loads the correct Apollo modules based on the runtime environment.
|
|
20
33
|
*/
|
|
@@ -113,15 +126,23 @@ async function getAuthToken() {
|
|
|
113
126
|
}
|
|
114
127
|
/**
|
|
115
128
|
* Processes the operation queue respecting the connection pool limits.
|
|
129
|
+
*
|
|
130
|
+
* Before executing each dequeued operation, this also performs a proactive
|
|
131
|
+
* queue-wait-timeout sweep: any operation that has been waiting longer than
|
|
132
|
+
* `queueWaitTimeoutMs` on its first attempt is rejected inline by its own
|
|
133
|
+
* `executeWithRetry` (attempt === 0 branch) rather than consuming a slot.
|
|
134
|
+
* The sweep runs here (not on a separate timer) because queue pressure
|
|
135
|
+
* almost always clears at the same moment a slot opens up, so the check
|
|
136
|
+
* is cheap and avoids introducing another timer.
|
|
116
137
|
*/
|
|
117
138
|
function processQueue() {
|
|
118
139
|
// Process queue until we reach max concurrent operations or queue is empty
|
|
119
140
|
while (pendingOperations < poolConfig.maxConcurrentOperations &&
|
|
120
141
|
operationQueue.length > 0) {
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
142
|
+
const entry = operationQueue.shift();
|
|
143
|
+
if (entry) {
|
|
123
144
|
pendingOperations++;
|
|
124
|
-
void
|
|
145
|
+
void entry.executeWithRetry().finally(() => {
|
|
125
146
|
pendingOperations--;
|
|
126
147
|
processQueue(); // Process next item after an operation completes
|
|
127
148
|
});
|
|
@@ -164,6 +185,50 @@ function extractOperationName(options) {
|
|
|
164
185
|
* timeouts are indistinguishable in logs and root-cause diagnosis is
|
|
165
186
|
* impossible.
|
|
166
187
|
*/
|
|
188
|
+
/**
|
|
189
|
+
* Classify an error as definitively non-retryable. These errors cost capacity
|
|
190
|
+
* when retried and cannot succeed without the caller changing behaviour:
|
|
191
|
+
*
|
|
192
|
+
* - **Accelerate 1102 "Worker exceeded resource limits"**: the Cloudflare
|
|
193
|
+
* Worker backing Prisma Accelerate hit its CPU/memory budget. Cloudflare's
|
|
194
|
+
* guidance is explicit: do not retry — retrying the same shape will hit
|
|
195
|
+
* the same limit and only inflates worker concurrency across the fleet,
|
|
196
|
+
* which can trigger broader throttling. Fix is at the caller (smaller
|
|
197
|
+
* batch, narrower selection, chunked write).
|
|
198
|
+
* - **P2002 unique-constraint violation**: another writer already inserted
|
|
199
|
+
* the conflicting row. Retrying the same mutation produces the same
|
|
200
|
+
* failure. Fix is at the caller (idempotent find-or-create, stable
|
|
201
|
+
* idempotency key, serialized writer).
|
|
202
|
+
* - **P2025 "record not found" race**: a concurrent delete/update removed
|
|
203
|
+
* the target row. Retrying a delete/update against a vanished row loops.
|
|
204
|
+
* - **GraphQL schema validation / 400 Bad Request**: the query itself is
|
|
205
|
+
* malformed; retrying guarantees the same 400.
|
|
206
|
+
*
|
|
207
|
+
* Explicit classification avoids the previous pattern where the generic
|
|
208
|
+
* `error.message.includes('Accelerate')` branch treated all Accelerate
|
|
209
|
+
* errors — including 1102 — as retryable, turning a single worker-limit
|
|
210
|
+
* breach into a retry storm that further starved the Accelerate worker
|
|
211
|
+
* pool. See Cloudflare error codes
|
|
212
|
+
* (https://developers.cloudflare.com/workers/observability/errors/#error-1102).
|
|
213
|
+
*/
|
|
214
|
+
function isDefinitivelyNonRetryable(message) {
|
|
215
|
+
return (
|
|
216
|
+
// Accelerate Worker resource-limit errors — never retry
|
|
217
|
+
message.includes('1102') ||
|
|
218
|
+
message.includes('Worker exceeded resource limits') ||
|
|
219
|
+
message.includes('Worker exceeded CPU') ||
|
|
220
|
+
message.includes('Worker exceeded memory') ||
|
|
221
|
+
// Prisma unique-constraint violation — retry just reproduces it
|
|
222
|
+
message.includes('P2002') ||
|
|
223
|
+
message.includes('Unique constraint failed') ||
|
|
224
|
+
// Prisma record-not-found race — deletes/updates already lost the row
|
|
225
|
+
message.includes('P2025') ||
|
|
226
|
+
message.includes('Record to update not found') ||
|
|
227
|
+
message.includes('Record to delete does not exist') ||
|
|
228
|
+
// GraphQL schema / 400 — malformed query, retry is pointless
|
|
229
|
+
message.includes('GRAPHQL_VALIDATION_FAILED') ||
|
|
230
|
+
message.includes('status code 400'));
|
|
231
|
+
}
|
|
167
232
|
async function enqueueOperation(operation, operationName, attempt = 0) {
|
|
168
233
|
// Load shedding: reject new (first-attempt) operations when the queue is
|
|
169
234
|
// saturated. This turns a cascading 30s timeout storm during backend
|
|
@@ -171,8 +236,8 @@ async function enqueueOperation(operation, operationName, attempt = 0) {
|
|
|
171
236
|
// retry later, or skip this cycle). Retries bypass this check because
|
|
172
237
|
// they represent in-flight commitments that already consumed backend
|
|
173
238
|
// capacity on the first attempt.
|
|
174
|
-
if (attempt === 0 &&
|
|
175
|
-
|
|
239
|
+
if (attempt === 0 && operationQueue.length >= poolConfig.maxQueueDepth) {
|
|
240
|
+
poolCounters.rejectedLoadShed++;
|
|
176
241
|
logger.warn(`Apollo operation '${operationName}' rejected — queue saturated (${operationQueue.length}/${poolConfig.maxQueueDepth})`, {
|
|
177
242
|
operation: operationName,
|
|
178
243
|
queueDepth: operationQueue.length,
|
|
@@ -195,6 +260,7 @@ async function enqueueOperation(operation, operationName, attempt = 0) {
|
|
|
195
260
|
if (attempt === 0) {
|
|
196
261
|
const waitMs = Date.now() - enqueuedAt;
|
|
197
262
|
if (waitMs > poolConfig.queueWaitTimeoutMs) {
|
|
263
|
+
poolCounters.rejectedQueueWaitTimeout++;
|
|
198
264
|
logger.warn(`Apollo operation '${operationName}' dropped — queue wait exceeded ${poolConfig.queueWaitTimeoutMs}ms (waited ${waitMs}ms)`, {
|
|
199
265
|
operation: operationName,
|
|
200
266
|
waitMs,
|
|
@@ -209,6 +275,7 @@ async function enqueueOperation(operation, operationName, attempt = 0) {
|
|
|
209
275
|
}
|
|
210
276
|
try {
|
|
211
277
|
const result = await operation();
|
|
278
|
+
poolCounters.executedTotal++;
|
|
212
279
|
resolve(result);
|
|
213
280
|
}
|
|
214
281
|
catch (error) {
|
|
@@ -234,10 +301,22 @@ async function enqueueOperation(operation, operationName, attempt = 0) {
|
|
|
234
301
|
// engine's database-operations-wrapper already handles this path with
|
|
235
302
|
// idempotent=true).
|
|
236
303
|
const isNonRetryableDelete = operationName.startsWith('deleteOne') && isTimeoutLike;
|
|
304
|
+
// Hard non-retry classes: retrying guarantees the same failure AND
|
|
305
|
+
// wastes backend capacity. Cross-check this list against caller-side
|
|
306
|
+
// handling — engine's graphql-error-handler should also treat these
|
|
307
|
+
// as non-retryable so double-wrapped callers don't re-retry.
|
|
308
|
+
const isHardNonRetryable = isDefinitivelyNonRetryable(errorMessage);
|
|
237
309
|
const isRetryable = !isNonRetryableDelete &&
|
|
310
|
+
!isHardNonRetryable &&
|
|
238
311
|
error instanceof Error &&
|
|
239
|
-
|
|
240
|
-
|
|
312
|
+
// Narrowed from the previous broad `includes('Accelerate')`: that
|
|
313
|
+
// matched 1102 (Worker resource-limit) and fed retry storms. Keep
|
|
314
|
+
// only transient Accelerate classes that genuinely benefit from
|
|
315
|
+
// retry (1016 = origin DNS temporarily unresolved, 1033 = worker
|
|
316
|
+
// script temporarily unreachable).
|
|
317
|
+
(error.message.includes('code: 1016') ||
|
|
318
|
+
error.message.includes('code: 1033') ||
|
|
319
|
+
error.message.includes('Accelerate transient') ||
|
|
241
320
|
error.message.includes('ECONNREFUSED') ||
|
|
242
321
|
error.message.includes('ECONNRESET') ||
|
|
243
322
|
error.message.includes('ETIMEDOUT') ||
|
|
@@ -262,14 +341,36 @@ async function enqueueOperation(operation, operationName, attempt = 0) {
|
|
|
262
341
|
category: 'SUPPRESSED_DELETE_RETRY',
|
|
263
342
|
});
|
|
264
343
|
}
|
|
344
|
+
if (isHardNonRetryable) {
|
|
345
|
+
poolCounters.rejectedNonRetryable++;
|
|
346
|
+
logger.warn(`Apollo operation '${operationName}' failed with non-retryable error — NOT retrying (would reproduce same failure or hit resource limit)`, {
|
|
347
|
+
operation: operationName,
|
|
348
|
+
attempt: attempt + 1,
|
|
349
|
+
error: errorMessage,
|
|
350
|
+
category: 'NON_RETRYABLE_HARD',
|
|
351
|
+
});
|
|
352
|
+
}
|
|
265
353
|
if (attempt < poolConfig.retryAttempts && isRetryable) {
|
|
266
|
-
|
|
354
|
+
// Decorrelated jitter: delay = random_between(retryDelay, base * 3)
|
|
355
|
+
// where base = retryDelay * 2^attempt. This breaks the thundering
|
|
356
|
+
// herd pattern where every op enqueued at the same stall moment
|
|
357
|
+
// retries at the same time (1.5s, 3s, 6s — all in lockstep) and
|
|
358
|
+
// overwhelms the backend the instant it recovers. See AWS
|
|
359
|
+
// architecture blog "Exponential Backoff And Jitter".
|
|
360
|
+
const base = poolConfig.retryDelay * Math.pow(2, attempt);
|
|
361
|
+
const upper = base * 3;
|
|
362
|
+
const lower = poolConfig.retryDelay;
|
|
363
|
+
const delay = lower >= upper
|
|
364
|
+
? upper
|
|
365
|
+
: randomInt(Math.floor(lower), Math.floor(upper) + 1);
|
|
366
|
+
poolCounters.retryAttemptsTotal++;
|
|
267
367
|
logger.warn(`Apollo operation '${operationName}' failed, retrying in ${delay}ms (attempt ${attempt + 1}/${poolConfig.retryAttempts})`, {
|
|
268
368
|
operation: operationName,
|
|
269
369
|
attempt: attempt + 1,
|
|
270
370
|
maxAttempts: poolConfig.retryAttempts,
|
|
271
371
|
delayMs: delay,
|
|
272
372
|
error: errorMessage,
|
|
373
|
+
category: 'RETRY',
|
|
273
374
|
});
|
|
274
375
|
setTimeout(() => {
|
|
275
376
|
enqueueOperation(operation, operationName, attempt + 1)
|
|
@@ -283,13 +384,14 @@ async function enqueueOperation(operation, operationName, attempt = 0) {
|
|
|
283
384
|
operation: operationName,
|
|
284
385
|
attempts: poolConfig.retryAttempts,
|
|
285
386
|
error: errorMessage,
|
|
387
|
+
category: 'RETRY_EXHAUSTED',
|
|
286
388
|
});
|
|
287
389
|
}
|
|
288
390
|
reject(error);
|
|
289
391
|
}
|
|
290
392
|
}
|
|
291
393
|
};
|
|
292
|
-
operationQueue.push(executeWithRetry);
|
|
394
|
+
operationQueue.push({ executeWithRetry, enqueuedAt, operationName });
|
|
293
395
|
processQueue();
|
|
294
396
|
});
|
|
295
397
|
}
|
|
@@ -496,6 +598,25 @@ export const client = {
|
|
|
496
598
|
return getApolloClient().then(onfulfilled, onrejected);
|
|
497
599
|
},
|
|
498
600
|
};
|
|
601
|
+
/**
|
|
602
|
+
* Returns a read-only snapshot of pool state for observability.
|
|
603
|
+
* Safe to call on every scrape interval (O(1)).
|
|
604
|
+
*/
|
|
605
|
+
export function getPoolStats() {
|
|
606
|
+
return {
|
|
607
|
+
pendingOperations,
|
|
608
|
+
queueDepth: operationQueue.length,
|
|
609
|
+
maxConcurrentOperations: poolConfig.maxConcurrentOperations,
|
|
610
|
+
maxQueueDepth: poolConfig.maxQueueDepth,
|
|
611
|
+
queueWaitTimeoutMs: poolConfig.queueWaitTimeoutMs,
|
|
612
|
+
connectionTimeoutMs: poolConfig.connectionTimeout,
|
|
613
|
+
executedTotal: poolCounters.executedTotal,
|
|
614
|
+
rejectedLoadShed: poolCounters.rejectedLoadShed,
|
|
615
|
+
rejectedQueueWaitTimeout: poolCounters.rejectedQueueWaitTimeout,
|
|
616
|
+
rejectedNonRetryable: poolCounters.rejectedNonRetryable,
|
|
617
|
+
retryAttemptsTotal: poolCounters.retryAttemptsTotal,
|
|
618
|
+
};
|
|
619
|
+
}
|
|
499
620
|
/**
|
|
500
621
|
* Gracefully stops the singleton Apollo Client and releases its resources.
|
|
501
622
|
* Call this during process shutdown to close keep-alive HTTP connections and
|
package/esm/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export type * as types from './generated/typegraphql-prisma/models/index.d.ts';
|
|
|
3
3
|
export * as enums from './generated/typegraphql-prisma/enums/index';
|
|
4
4
|
export * from './generated/typeStrings/index';
|
|
5
5
|
export * from './resolvers/custom/index';
|
|
6
|
-
export { getApolloClient, getApolloModules, configureConnectionPool, setTokenProvider, stopClient, client } from './client';
|
|
7
|
-
export type { ApolloClientType, InMemoryCacheType, HttpLinkType, NormalizedCacheObject, TokenProvider, } from './client';
|
|
6
|
+
export { getApolloClient, getApolloModules, configureConnectionPool, setTokenProvider, stopClient, getPoolStats, client } from './client';
|
|
7
|
+
export type { ApolloClientType, InMemoryCacheType, HttpLinkType, NormalizedCacheObject, TokenProvider, PoolStats, } from './client';
|
|
8
8
|
declare const adaptic: {
|
|
9
9
|
aBTest: {
|
|
10
10
|
create(props: import("./generated/typegraphql-prisma/models/ABTest.js").ABTest, globalClient?: import("@apollo/client/core/ApolloClient.js").ApolloClient<import("@apollo/client/cache/inmemory/types.js").NormalizedCacheObject>): Promise<import("./generated/typegraphql-prisma/models/ABTest.js").ABTest>;
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAE1B,YAAY,KAAK,KAAK,MAAM,kDAAkD,CAAC;AAC/E,OAAO,KAAK,KAAK,MAAM,4CAA4C,CAAC;AACpE,cAAc,+BAA+B,CAAC;AAG9C,cAAc,0BAA0B,CAAC;AAGzC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,UAAU,EACV,MAAM,EACP,MAAM,UAAU,CAAC;AAElB,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAE1B,YAAY,KAAK,KAAK,MAAM,kDAAkD,CAAC;AAC/E,OAAO,KAAK,KAAK,MAAM,4CAA4C,CAAC;AACpE,cAAc,+BAA+B,CAAC;AAG9C,cAAc,0BAA0B,CAAC;AAGzC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,MAAM,EACP,MAAM,UAAU,CAAC;AAElB,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,SAAS,GACV,MAAM,UAAU,CAAC;AAoElB,QAAA,MAAM,OAAO;;;;0BAoEk5zI,CAAC;;;;;;;;;;;;;;;;;0BAA90yG,CAAC;;;;;;;;;;;;;;;;;0BAA9v4B,CAAC;;;;;;;;;;;;;;;;;0BAA274B,CAAC;;;;;;;;;;;;;;;;;0BAA3p3B,CAAC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IAC1C,eAAe,EAAE,eAAe;IAChC,oBAAoB,EAAE,oBAAoB;IAC1C,qBAAqB,EAAE,qBAAqB;IAC5C,aAAa,EAAE,aAAa;IAC5B,sBAAsB,EAAE,sBAAsB;IAC9C,oBAAoB,EAAE,oBAAoB;IAC1C,OAAO,EAAE,OAAO;IAChB,sBAAsB,EAAE,sBAAsB;IAC9C,aAAa,EAAE,aAAa;IAC5B,aAAa,EAAE,aAAa;IAC5B,mBAAmB,EAAE,mBAAmB;IACxC,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,WAAW;IACxB,KAAK,EAAE,KAAK;IACZ,eAAe,EAAE,eAAe;IAChC,qBAAqB,EAAE,qBAAqB;IAC5C,YAAY,EAAE,YAAY;IAC1B,aAAa,EAAE,aAAa;IAC5B,IAAI,EAAE,IAAI;IACV,iBAAiB,EAAE,iBAAiB;IACpC,aAAa,EAAE,aAAa;CAC7B,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/esm/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export * from './generated/typeStrings/index.mjs';
|
|
|
7
7
|
// Export custom resolvers
|
|
8
8
|
export * from "./resolvers/custom/index.mjs";
|
|
9
9
|
// Re-export Apollo Client functions from client.ts
|
|
10
|
-
export { getApolloClient, getApolloModules, configureConnectionPool, setTokenProvider, stopClient, client } from "./client.mjs";
|
|
10
|
+
export { getApolloClient, getApolloModules, configureConnectionPool, setTokenProvider, stopClient, getPoolStats, client } from "./client.mjs";
|
|
11
11
|
import { ABTest } from './ABTest.mjs';
|
|
12
12
|
import { Account } from './Account.mjs';
|
|
13
13
|
import { AccountDecisionRecord } from './AccountDecisionRecord.mjs';
|
package/index.cjs
CHANGED
|
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.client = exports.stopClient = exports.setTokenProvider = exports.configureConnectionPool = exports.getApolloModules = exports.getApolloClient = exports.enums = void 0;
|
|
39
|
+
exports.client = exports.getPoolStats = exports.stopClient = exports.setTokenProvider = exports.configureConnectionPool = exports.getApolloModules = exports.getApolloClient = exports.enums = void 0;
|
|
40
40
|
// This file is auto-generated by modules/index.d.ts
|
|
41
41
|
// CRITICAL: Import reflect-metadata FIRST before any TypeGraphQL code
|
|
42
42
|
// This polyfill must be loaded before any decorators are evaluated
|
|
@@ -52,6 +52,7 @@ Object.defineProperty(exports, "getApolloModules", { enumerable: true, get: func
|
|
|
52
52
|
Object.defineProperty(exports, "configureConnectionPool", { enumerable: true, get: function () { return client_1.configureConnectionPool; } });
|
|
53
53
|
Object.defineProperty(exports, "setTokenProvider", { enumerable: true, get: function () { return client_1.setTokenProvider; } });
|
|
54
54
|
Object.defineProperty(exports, "stopClient", { enumerable: true, get: function () { return client_1.stopClient; } });
|
|
55
|
+
Object.defineProperty(exports, "getPoolStats", { enumerable: true, get: function () { return client_1.getPoolStats; } });
|
|
55
56
|
Object.defineProperty(exports, "client", { enumerable: true, get: function () { return client_1.client; } });
|
|
56
57
|
const ABTest_1 = require("./ABTest.cjs");
|
|
57
58
|
const Account_1 = require("./Account.cjs");
|
package/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export type * as types from './generated/typegraphql-prisma/models/index.d.ts';
|
|
|
3
3
|
export * as enums from './generated/typegraphql-prisma/enums/index';
|
|
4
4
|
export * from './generated/typeStrings/index';
|
|
5
5
|
export * from './resolvers/custom/index';
|
|
6
|
-
export { getApolloClient, getApolloModules, configureConnectionPool, setTokenProvider, stopClient, client } from './client';
|
|
7
|
-
export type { ApolloClientType, InMemoryCacheType, HttpLinkType, NormalizedCacheObject, TokenProvider, } from './client';
|
|
6
|
+
export { getApolloClient, getApolloModules, configureConnectionPool, setTokenProvider, stopClient, getPoolStats, client } from './client';
|
|
7
|
+
export type { ApolloClientType, InMemoryCacheType, HttpLinkType, NormalizedCacheObject, TokenProvider, PoolStats, } from './client';
|
|
8
8
|
declare const adaptic: {
|
|
9
9
|
aBTest: {
|
|
10
10
|
create(props: import("./generated/typegraphql-prisma/models/ABTest.js").ABTest, globalClient?: import("@apollo/client/core/ApolloClient.js").ApolloClient<import("@apollo/client/cache/inmemory/types.js").NormalizedCacheObject>): Promise<import("./generated/typegraphql-prisma/models/ABTest.js").ABTest>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptic/backend-legacy",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.962",
|
|
4
4
|
"description": "Backend executable CRUD functions with dynamic variables construction, and type definitions for the Adaptic AI platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "index.d.ts",
|