@sentio/runtime 2.59.0 → 2.59.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.
@@ -1,4 +1,4 @@
1
1
  import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
2
- import{a as k}from"./chunk-JPHAFAK7.js";import{$ as I,W as C,c as h,j as R,p as x,q as y,s as q}from"./chunk-UWKXTTDA.js";import{e as E}from"./chunk-VUN3TGG5.js";var s=E(x(),1);var i=E(y(),1);import{threadId as o}from"worker_threads";import{Piscina as L}from"piscina";var D=E(C(),1),b=!1,u;process.on("uncaughtException",e=>{console.error("Uncaught Exception, please checking if await is properly used",e),u=e}).on("unhandledRejection",(e,t)=>{e?.message.startsWith('invalid ENS name (disallowed character: "*"')||(console.error("Unhandled Rejection, please checking if await is properly",e),u=e)}).on("exit",()=>{console.info("Worker thread exiting, threadId:",o)});var d,A=async e=>{if(e.target){let t=await import(e.target);return console.debug("Module loaded, path:",e.target,"module:",t),t}},v={};async function N(e,t){if(b)return{};q();try{d=new I(()=>A(t),t)}catch(a){throw new s.ServerError(s.Status.INVALID_ARGUMENT,"Failed to load processor: "+h(a))}return await d.start(e,v),b=!0,{}}async function z({processId:e,request:t,workerPort:a}){let{startRequest:p,configRequest:w,options:n}=L.workerData;if(!b){let r=process.env.LOG_LEVEL?.toUpperCase();k(n["log-format"]==="json",r==="debug"?!0:n.debug,o),R(n),p&&(await N(p,n),console.debug("worker",o," started, template instance:",p.templateInstances?.length)),w&&(await d?.getConfig(w,v),console.debug("worker",o," configured"))}if(u){let r=u;throw u=void 0,console.error("Unhandled exception/rejection in previous request:",r),new i.RichServerError(s.Status.UNAVAILABLE,"Unhandled exception/rejection in previous request: "+h(r),[i.DebugInfo.fromPartial({detail:r.message,stackEntries:r.stack?.split(`
2
+ import{a as k}from"./chunk-JPHAFAK7.js";import{$ as I,W as C,c as h,j as R,p as x,q as y,s as q}from"./chunk-X4FFDWU5.js";import{e as E}from"./chunk-VUN3TGG5.js";var s=E(x(),1);var i=E(y(),1);import{threadId as o}from"worker_threads";import{Piscina as L}from"piscina";var D=E(C(),1),b=!1,u;process.on("uncaughtException",e=>{console.error("Uncaught Exception, please checking if await is properly used",e),u=e}).on("unhandledRejection",(e,t)=>{e?.message.startsWith('invalid ENS name (disallowed character: "*"')||(console.error("Unhandled Rejection, please checking if await is properly",e),u=e)}).on("exit",()=>{console.info("Worker thread exiting, threadId:",o)});var d,A=async e=>{if(e.target){let t=await import(e.target);return console.debug("Module loaded, path:",e.target,"module:",t),t}},v={};async function N(e,t){if(b)return{};q();try{d=new I(()=>A(t),t)}catch(a){throw new s.ServerError(s.Status.INVALID_ARGUMENT,"Failed to load processor: "+h(a))}return await d.start(e,v),b=!0,{}}async function z({processId:e,request:t,workerPort:a}){let{startRequest:p,configRequest:w,options:n}=L.workerData;if(!b){let r=process.env.LOG_LEVEL?.toUpperCase();k(n["log-format"]==="json",r==="debug"?!0:n.debug,o),R(n),p&&(await N(p,n),console.debug("worker",o," started, template instance:",p.templateInstances?.length)),w&&(await d?.getConfig(w,v),console.debug("worker",o," configured"))}if(u){let r=u;throw u=void 0,console.error("Unhandled exception/rejection in previous request:",r),new i.RichServerError(s.Status.UNAVAILABLE,"Unhandled exception/rejection in previous request: "+h(r),[i.DebugInfo.fromPartial({detail:r.message,stackEntries:r.stack?.split(`
3
3
  `)})])}let l=n["worker-timeout"]||0,S=n["enable-partition"]||!1;await new Promise((r,P)=>{let f=new D.Subject,m;f.subscribe(c=>{console.debug("Worker",o,"send response:",c.result?"result":"dbResult"),a.postMessage(c),c.result&&(m&&clearTimeout(m),r(),a.close())}),a.on("message",c=>{let g=c;console.debug("Worker",o,"received request:",g.start?"start":"dbResult"),d?.handleRequest(g,t.binding,f),S&&g.start&&l>0&&(m=setTimeout(async()=>{P(new i.RichServerError(s.Status.DEADLINE_EXCEEDED,"Worker timeout exceeded"))},l))}),console.debug("Worker",o,"handle request: binding"),d?.handleRequest(t,t.binding,f),!S&&l>0&&(m=setTimeout(()=>{P(new i.RichServerError(s.Status.DEADLINE_EXCEEDED,"Worker timeout exceeded"))},l))})}import("node:process").then(e=>e.stdout.write(""));export{z as default};
4
4
  //# sourceMappingURL=service-worker.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
- "version": "2.59.0",
3
+ "version": "2.59.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
package/src/db-context.ts CHANGED
@@ -131,11 +131,11 @@ export abstract class AbstractStoreContext implements IStoreContext {
131
131
  }
132
132
 
133
133
  error(processId: number, e: any) {
134
- const stack = new Error().stack
134
+ const stack = e.stack
135
135
  console.error('process error', processId, e, stack)
136
136
  const errorResult = ProcessResult.create({
137
137
  states: {
138
- error: e?.toString()
138
+ error: e?.toString() + (stack ? `\n${stack}` : '')
139
139
  }
140
140
  })
141
141
  this.doSend({ result: errorResult, processId })
package/src/service.ts CHANGED
@@ -505,7 +505,7 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
505
505
  recordRuntimeInfo(result, binding.handlerType)
506
506
  })
507
507
  .catch((e) => {
508
- console.error(e)
508
+ console.error(e, e.stack)
509
509
  dbContext.error(processId, e)
510
510
  process_binding_error.add(1)
511
511
  })