@sentio/runtime 2.58.1-rc.1 → 2.58.2-rc.1

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.
@@ -19815,7 +19815,7 @@ function appendRootPathToUrlIfNeeded(url) {
19815
19815
  return void 0;
19816
19816
  }
19817
19817
  }
19818
- function appendResourcePathToUrl(url, path2) {
19818
+ function appendResourcePathToUrl(url, path3) {
19819
19819
  try {
19820
19820
  new URL(url);
19821
19821
  } catch (_a2) {
@@ -19825,11 +19825,11 @@ function appendResourcePathToUrl(url, path2) {
19825
19825
  if (!url.endsWith("/")) {
19826
19826
  url = url + "/";
19827
19827
  }
19828
- url += path2;
19828
+ url += path3;
19829
19829
  try {
19830
19830
  new URL(url);
19831
19831
  } catch (_b) {
19832
- diag.warn("Configuration: Provided URL appended with '" + path2 + "' is not a valid URL, using 'undefined' instead of '" + url + "'");
19832
+ diag.warn("Configuration: Provided URL appended with '" + path3 + "' is not a valid URL, using 'undefined' instead of '" + url + "'");
19833
19833
  return void 0;
19834
19834
  }
19835
19835
  return url;
@@ -20025,10 +20025,10 @@ var require_create_service_client_constructor = __commonJS({
20025
20025
  Object.defineProperty(exports, "__esModule", { value: true });
20026
20026
  exports.createServiceClientConstructor = void 0;
20027
20027
  var grpc = require_src();
20028
- function createServiceClientConstructor(path2, name) {
20028
+ function createServiceClientConstructor(path3, name) {
20029
20029
  const serviceDefinition = {
20030
20030
  export: {
20031
- path: path2,
20031
+ path: path3,
20032
20032
  requestStream: false,
20033
20033
  responseStream: false,
20034
20034
  requestSerialize: (arg) => {
@@ -20244,7 +20244,7 @@ var require_otlp_grpc_env_configuration = __commonJS({
20244
20244
  var grpc_exporter_transport_1 = require_grpc_exporter_transport();
20245
20245
  var node_http_1 = (init_index_node_http(), __toCommonJS(index_node_http_exports));
20246
20246
  var fs3 = __require("fs");
20247
- var path2 = __require("path");
20247
+ var path3 = __require("path");
20248
20248
  var api_1 = (init_esm(), __toCommonJS(esm_exports));
20249
20249
  function fallbackIfNullishOrBlank(signalSpecific, nonSignalSpecific) {
20250
20250
  if (signalSpecific != null && signalSpecific !== "") {
@@ -20297,7 +20297,7 @@ var require_otlp_grpc_env_configuration = __commonJS({
20297
20297
  const filePath = fallbackIfNullishOrBlank(signalSpecificPath, nonSignalSpecificPath);
20298
20298
  if (filePath != null) {
20299
20299
  try {
20300
- return fs3.readFileSync(path2.resolve(process.cwd(), filePath));
20300
+ return fs3.readFileSync(path3.resolve(process.cwd(), filePath));
20301
20301
  } catch (_c) {
20302
20302
  api_1.diag.warn(warningMessage);
20303
20303
  return void 0;
@@ -26420,6 +26420,7 @@ var ChannelStoreContext = class {
26420
26420
  import("node:process").then((p) => p.stdout.write(""));
26421
26421
 
26422
26422
  // src/processor-runner.ts
26423
+ import path2 from "path";
26423
26424
  var workerNum = 1;
26424
26425
  try {
26425
26426
  workerNum = parseInt(process.env["PROCESSOR_WORKER"]?.trim() ?? "1");
@@ -26548,12 +26549,14 @@ process.on("SIGINT", function() {
26548
26549
  });
26549
26550
  if (process.env["OOM_DUMP_MEMORY_SIZE_GB"]) {
26550
26551
  let dumping = false;
26551
- const memorySize = parseInt(process.env["OOM_DUMP_MEMORY_SIZE_GB"], 10);
26552
+ const memorySize = parseFloat(process.env["OOM_DUMP_MEMORY_SIZE_GB"]);
26552
26553
  console.log("heap dumping is enabled, limit set to ", memorySize, "gb");
26554
+ const dir = process.env["OOM_DUMP_DIR"] || "/tmp";
26553
26555
  setInterval(async () => {
26554
26556
  const mem = process.memoryUsage();
26557
+ console.log("Current Memory Usage", mem);
26555
26558
  if (mem.heapTotal > memorySize * 1024 * 1024 * 1024 && !dumping) {
26556
- const file = "/tmp/" + Date.now() + ".heapsnapshot";
26559
+ const file = path2.join(dir, `${Date.now()}.heapsnapshot`);
26557
26560
  dumping = true;
26558
26561
  await dumpHeap(file);
26559
26562
  process.exit(11);
@@ -26563,6 +26566,7 @@ if (process.env["OOM_DUMP_MEMORY_SIZE_GB"]) {
26563
26566
  async function dumpHeap(file) {
26564
26567
  console.log("Heap dumping to", file);
26565
26568
  const session = new Session();
26569
+ import_fs_extra2.default.mkdirSync(path2.dirname(file), { recursive: true });
26566
26570
  const fd = import_fs_extra2.default.openSync(file, "w");
26567
26571
  try {
26568
26572
  session.connect();