@sentio/runtime 4.3.5-rc.2 → 4.3.5-rc.3
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/dist/index.js +1 -1
- package/dist/plugin-0w1rBRGy.d.ts.map +1 -1
- package/dist/processor-runner.js +1 -1
- package/dist/{service-v3-piYZ9lK8.js → service-v3-hRmfCtqr.js} +36 -2
- package/dist/{service-v3-piYZ9lK8.js.map → service-v3-hRmfCtqr.js.map} +1 -1
- package/package.json +1 -1
- package/src/db-context.ts +63 -8
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as PluginManager, t as Plugin } from "./plugin-9jInRbdc.js";
|
|
2
|
-
import { C as mergeProcessResults, E as recordRuntimeInfo, S as makeEthCallKey, T as parseSemver, a as StoreContext, b as errorString, c as metricsStorage, g as configureEndpoints, h as Endpoints, i as DataBindingContext, l as processMetrics, n as GLOBAL_CONFIG, o as timeoutError, r as AbstractStoreContext, s as dbMetrics, t as ProcessorServiceImplV3, u as providerMetrics, v as USER_PROCESSOR, w as mergeProcessResultsInPlace, x as locatePackageJson, y as compareSemver } from "./service-v3-
|
|
2
|
+
import { C as mergeProcessResults, E as recordRuntimeInfo, S as makeEthCallKey, T as parseSemver, a as StoreContext, b as errorString, c as metricsStorage, g as configureEndpoints, h as Endpoints, i as DataBindingContext, l as processMetrics, n as GLOBAL_CONFIG, o as timeoutError, r as AbstractStoreContext, s as dbMetrics, t as ProcessorServiceImplV3, u as providerMetrics, v as USER_PROCESSOR, w as mergeProcessResultsInPlace, x as locatePackageJson, y as compareSemver } from "./service-v3-hRmfCtqr.js";
|
|
3
3
|
|
|
4
4
|
//#region src/state.ts
|
|
5
5
|
var State = class State {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-0w1rBRGy.d.ts","names":[],"sources":["../src/db-context.ts","../src/plugin.ts"],"mappings":";;;;;;KA8BK,yBAAA,GAA4B,gBAAg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BAAA,CAAkB,OAAA,EAAS,WAAA,EAAa,eAAA;IAAA,CAAoB,CAAA;EAAA,IAAoB,OAAA,CAAQ,gBAAA;EAIxF,SAAA,CAAU,OAAA,EAAS,WAAA,GAAc,OAAA,CAAQ,gCAAA;;;ADLuC;AAAA;EC0BhF,WAAA,CAAY,IAAA,YAAgB,OAAA;;;;EAKlC,cAAA;AAAA;AAAA,cAGW,aAAA;EAAA,OACJ,QAAA,EAAQ,aAAA;EAEf,qBAAA,EAAqB,iBAAA,CAAA,mBAAA,GAAA,aAAA;EACrB,OAAA,EAAS,MAAA;EACT,aAAA,EAAa,GAAA,CAAA,WAAA,EAAA,MAAA;EAEb,QAAA,CAAS,MAAA,EAAQ,MAAA;EAeX,SAAA,CAAU,MAAA,EAAQ,qBAAA,GAAwB,OAAA;EAMhD,KAAA,CAAM,KAAA,EAAO,YAAA,EAAc,gBAAA,YAAyB,OAAA;EAIpD,WAAA,CAAY,IAAA,YAAa,OAAA;EAIzB,QAAA;EAIA,cAAA,CACE,OAAA,EAAS,WAAA,EACT,YAAA,EAAc,YAAA,cACd,SAAA,GAAY,mBAAA,GAAsB,aAAA,GACjC,OAAA,CAAQ,aAAA;EAUL,SAAA,CAAU,OAAA,EAAS,WAAA,GAAc,OAAA,CAAQ,gCAAA;EAQ/C,iBAAA,CACE,OAAA,EAAS,WAAA,EACT,eAAA;IAAA,CAAoB,CAAA;EAAA,GACpB,SAAA,GAAY,mBAAA,GAAsB,aAAA,GACjC,OAAA,CAAQ,gBAAA;EAUL,eAAA,CAAgB,OAAA,EAAS,sBAAA,GAAsB,OAAA;AAAA"}
|
package/dist/processor-runner.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { a as diag, c as init_consoleLogger, d as __commonJSMin, f as __esmMin, g as __toESM, h as __toCommonJS, i as metrics, l as DiagLogLevel, m as __require, n as init_esm$2, o as init_diag_api, p as __exportAll, r as init_metrics_api, s as DiagConsoleLogger, t as esm_exports$2, u as init_types$1 } from "./esm-CSGQo6hb.js";
|
|
3
3
|
import { A as WireType, B as protoInt64, C as create, D as formatVal, E as checkField, F as messageDesc, H as protoSnakeCase, I as base64Decode, L as base64Encode, M as FieldError, N as isFieldError, O as BinaryReader, P as MethodOptions_IdempotencyLevel, R as scalarZeroValue, S as reflect, T as isWrapperDesc, V as protoCamelCase, a as ExecutionConfigSchema, b as makeReadContext$1, g as ValueSchema, h as StructSchema, k as BinaryWriter, m as NullValue, n as PluginManager, p as ListValueSchema, s as ProcessConfigResponseSchema, u as ProcessorV3, v as fileDesc, w as hasCustomJsonRepresentation, x as readField$1, y as fromBinary, z as ScalarType } from "./plugin-9jInRbdc.js";
|
|
4
|
-
import { _ as require_lib, d as ConnectError, f as codeFromString, g as configureEndpoints, m as Code, n as GLOBAL_CONFIG, p as codeToString, t as ProcessorServiceImplV3, x as locatePackageJson } from "./service-v3-
|
|
4
|
+
import { _ as require_lib, d as ConnectError, f as codeFromString, g as configureEndpoints, m as Code, n as GLOBAL_CONFIG, p as codeToString, t as ProcessorServiceImplV3, x as locatePackageJson } from "./service-v3-hRmfCtqr.js";
|
|
5
5
|
import * as path$4 from "path";
|
|
6
6
|
import { dirname, join } from "path";
|
|
7
7
|
import * as fs$7 from "fs";
|
|
@@ -11858,6 +11858,9 @@ const { request_errors, unsolved_requests, request_times, batched_request_count,
|
|
|
11858
11858
|
const STORE_BATCH_IDLE = process$2.env["STORE_BATCH_MAX_IDLE"] ? parseInt(process$2.env["STORE_BATCH_MAX_IDLE"]) : 1;
|
|
11859
11859
|
const STORE_BATCH_SIZE = process$2.env["STORE_BATCH_SIZE"] ? parseInt(process$2.env["STORE_BATCH_SIZE"]) : 10;
|
|
11860
11860
|
const STORE_UPSERT_NO_WAIT = process$2.env["STORE_UPSERT_NO_WAIT"] === "true";
|
|
11861
|
+
const MAX_HEAD_FRAMES = 8;
|
|
11862
|
+
const MAX_TAIL_FRAMES = 4;
|
|
11863
|
+
const STACK_CAPTURE_DEPTH = 50;
|
|
11861
11864
|
const timeoutError = /* @__PURE__ */ new Error("timeout");
|
|
11862
11865
|
function describeRequest(request) {
|
|
11863
11866
|
switch (request.case) {
|
|
@@ -11872,6 +11875,30 @@ function describeRequest(request) {
|
|
|
11872
11875
|
default: return request.case ?? "op";
|
|
11873
11876
|
}
|
|
11874
11877
|
}
|
|
11878
|
+
/**
|
|
11879
|
+
* Keep both ends of a stack, dropping the middle when it is too long to inline.
|
|
11880
|
+
*
|
|
11881
|
+
* A diagnostic must not grow with the depth of what it describes, but truncating from one
|
|
11882
|
+
* end throws away half of what makes it useful: the top frames are where the late call was
|
|
11883
|
+
* made, the bottom ones the entry point that led there.
|
|
11884
|
+
*
|
|
11885
|
+
* Node's own internals are dropped first so the budget goes to frames the reader can act
|
|
11886
|
+
* on — otherwise a deep call inside the test runner or the processor host fills the tail
|
|
11887
|
+
* with `node:internal/...` and pushes the user's entry point into the omitted middle.
|
|
11888
|
+
* V8-synthesised markers like `async Promise.all (index 3)` are not `node:` frames and are
|
|
11889
|
+
* kept; they are often the single most informative line.
|
|
11890
|
+
*/
|
|
11891
|
+
function boundedFrames(frames) {
|
|
11892
|
+
const ownCode = frames.filter((frame) => !frame.includes("node:"));
|
|
11893
|
+
const usable = ownCode.length ? ownCode : frames;
|
|
11894
|
+
if (usable.length <= 12) return usable;
|
|
11895
|
+
const omitted = usable.length - MAX_HEAD_FRAMES - MAX_TAIL_FRAMES;
|
|
11896
|
+
return [
|
|
11897
|
+
...usable.slice(0, MAX_HEAD_FRAMES),
|
|
11898
|
+
` ... ${omitted} frame(s) omitted ...`,
|
|
11899
|
+
...usable.slice(-4)
|
|
11900
|
+
];
|
|
11901
|
+
}
|
|
11875
11902
|
var AbstractStoreContext = class {
|
|
11876
11903
|
processId;
|
|
11877
11904
|
static opCounter = 0n;
|
|
@@ -12048,8 +12075,15 @@ var AbstractStoreContext = class {
|
|
|
12048
12075
|
* reads is their own code rather than two frames of ours.
|
|
12049
12076
|
*/
|
|
12050
12077
|
reportLateMessage(what, boundary) {
|
|
12051
|
-
const
|
|
12078
|
+
const summary = `[sentio] ${what} was issued after process ${this.processId} had already finished, so it was dropped. Something in the handler was still running after the handler returned — every store write, store read and metric must be awaited before the handler completes. A common cause is one Promise.all() branch rejecting while its siblings keep running: Promise.all rejects immediately but does NOT cancel the others, so give each branch its own .catch() (or use Promise.allSettled) to keep them inside the handler.`;
|
|
12079
|
+
const previousLimit = Error.stackTraceLimit;
|
|
12080
|
+
Error.stackTraceLimit = Math.max(previousLimit, STACK_CAPTURE_DEPTH);
|
|
12081
|
+
const err = new Error(summary);
|
|
12052
12082
|
Error.captureStackTrace?.(err, boundary ?? this.reportLateMessage);
|
|
12083
|
+
const captured = err.stack ?? "";
|
|
12084
|
+
Error.stackTraceLimit = previousLimit;
|
|
12085
|
+
const frames = boundedFrames(captured.split("\n").slice(1));
|
|
12086
|
+
if (frames.length) err.message = `${summary}\nIssued at:\n${frames.join("\n")}`;
|
|
12053
12087
|
console.error(err);
|
|
12054
12088
|
return err;
|
|
12055
12089
|
}
|
|
@@ -12302,4 +12336,4 @@ var Contexts = class {
|
|
|
12302
12336
|
|
|
12303
12337
|
//#endregion
|
|
12304
12338
|
export { mergeProcessResults as C, recordRuntimeInfo as E, makeEthCallKey as S, parseSemver as T, require_lib as _, StoreContext as a, errorString as b, metricsStorage as c, ConnectError as d, codeFromString as f, configureEndpoints as g, Endpoints as h, DataBindingContext as i, processMetrics as l, Code as m, GLOBAL_CONFIG as n, timeoutError as o, codeToString as p, AbstractStoreContext as r, dbMetrics as s, ProcessorServiceImplV3 as t, providerMetrics as u, USER_PROCESSOR as v, mergeProcessResultsInPlace as w, locatePackageJson as x, compareSemver as y };
|
|
12305
|
-
//# sourceMappingURL=service-v3-
|
|
12339
|
+
//# sourceMappingURL=service-v3-hRmfCtqr.js.map
|