You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working on trying to identify what causes a memory access out of bounds CompileError in some queue handlers - see cloudflare/workers-rs#374 - I stumbled upon the fact that I can't use recordCoredump for workers that handle queue events or cron triggers, since they lack a request object.
My entry.mjs file looks as follows:
importshim,{getMemory,wasmModule}from"../build/worker/shim.mjs"import{recordCoredump}from"@cloudflare/wasm-coredump"consttimeoutSecs=60;asyncfunctionfetch(request,env,ctx){try{// see https://github.com/rustwasm/wasm-bindgen/issues/2724.returnawaitPromise.race([shim.fetch(request,env,ctx),newPromise((r,e)=>setTimeout(()=>e("timeout"),timeoutSecs*1000))]);}catch(err){console.error(err);constmemory=getMemory();constcoredumpService=env.COREDUMP_SERVICE;awaitrecordCoredump({ memory, wasmModule, request, coredumpService });throwerr;}}asyncfunctionqueue(batch,env,ctx){try{// see https://github.com/rustwasm/wasm-bindgen/issues/2724.returnawaitPromise.race([shim.queue(batch,env,ctx),newPromise((r,e)=>setTimeout(()=>e("timeout"),timeoutSecs*1000))]);}catch(err){console.error(err);constmemory=getMemory();constcoredumpService=env.COREDUMP_SERVICE;awaitrecordCoredump({ memory, wasmModule, request, coredumpService });throwerr;}}asyncfunctionscheduled(event,env,ctx){try{// see https://github.com/rustwasm/wasm-bindgen/issues/2724.returnawaitPromise.race([shim.scheduled(event,env,ctx),newPromise((r,e)=>setTimeout(()=>e("timeout"),timeoutSecs*1000))]);}catch(err){console.error(err);constmemory=getMemory();constcoredumpService=env.COREDUMP_SERVICE;awaitrecordCoredump({ memory, wasmModule, request, coredumpService });throwerr;}}exportdefault{ fetch, queue, scheduled };
However the calls to recordCoredump from queue and scheduled fail with exception:
"exceptions": [
{
"name": "ReferenceError",
"message": "request is not defined",
"timestamp": 1693489675116
}
],
It would be nice if the request parameter was made optional and handled without error if it's not passed, so that I can perform core dumps for cron triggers and queue consumers.
The text was updated successfully, but these errors were encountered:
Working on trying to identify what causes a
memory access out of bounds CompileError
in some queue handlers - see cloudflare/workers-rs#374 - I stumbled upon the fact that I can't userecordCoredump
for workers that handle queue events or cron triggers, since they lack arequest
object.My
entry.mjs
file looks as follows:However the calls to
recordCoredump
fromqueue
andscheduled
fail with exception:It would be nice if the
request
parameter was made optional and handled without error if it's not passed, so that I can perform core dumps for cron triggers and queue consumers.The text was updated successfully, but these errors were encountered: