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
Recently, I deployed a Node.js service in a Docker container, and there are occasional instances of the service becoming unresponsive. Since I'm not very familiar with Skia, I'm not sure if it's a Skia issue. So I'm asking everyone for ideas on how to approach this(Willing to pay for advice.).
Phenomenon: The service does not accept any signals. The service is in an Ssl state. It seems that the internal code of the service is in a "Stop the world" state, and its internal code execution is suspended (such as zookeeper heartbeat not sent).
Suspicious business process
Cache images (because most of the images are the same, so cache reuse) [the biggest suspect in my option]
constcache=newMap();constgetImg=async(url)=>{if(cache.has(url)){constret=cache.get(url);ret._timer();returnret;}cache.set(url,get(url).then(loadImage).then((img)=>{// This is a unified encapsulation, similar to a debounce algorithm.let_timer=()=>{};img._timer=()=>{_timer=clearTimeout.bind(null,setTimeout(cache.delete.bind(cache,url),lts).unref());};cache.set(url,img);returnimg;}),);returngetImg(url);};
I suspect that during the deletion of lts, the img in drawImage(img) is being garbage collected, which leads to the mutex lock waiting. or a private method(_timer) is bound to img.
Because there are many lines to be drawn, I borrowed the concept of fibers and enforced waiting.
This code snippet looks very sus, but I can recommend in case using this lib a lot in back-end having the service restarted time to time, it still has multiple memory-leak.
constcache=newMap();constgetImg=async(url)=>{if(cache.has(url)){constret=cache.get(url);ret._timer();returnret;}cache.set(url,get(url).then(loadImage).then((img)=>{// This is a unified encapsulation, similar to a debounce algorithm.let_timer=()=>{};img._timer=()=>{_timer=clearTimeout.bind(null,setTimeout(cache.delete.bind(cache,url),lts).unref());};cache.set(url,img);returnimg;}),);returngetImg(url);};
Recently, I deployed a Node.js service in a Docker container, and there are occasional instances of the service becoming unresponsive. Since I'm not very familiar with Skia, I'm not sure if it's a Skia issue. So I'm asking everyone for ideas on how to approach this(Willing to pay for advice.).
Phenomenon: The service does not accept any signals. The service is in an Ssl state. It seems that the internal code of the service is in a "Stop the world" state, and its internal code execution is suspended (such as zookeeper heartbeat not sent).
Suspicious business process
lts
, theimg
indrawImage(img)
is being garbage collected, which leads to the mutex lock waiting. or a private method(_timer
) is bound toimg
.env info
Call stack:
gdb stack:
The text was updated successfully, but these errors were encountered: