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
I create two thread to run the follow:
Object object = sandbox.getSandboxedInvocable().invokeFunction(DECODE_FUNCTION, message);
My script can return two different result according to the params in message. But the return result are not int right order.
So I change the executor to Executors.newSingleThreadExecutor(). And the order is right. But reach the memory limit after run for a few time.
I guass is there any threading issues when executor has more than one thread? And the memory monitor calcute
inaccurete when the executor has one thread?
The text was updated successfully, but these errors were encountered:
If there are is only one or multiple executors defined for the sandbox shouldn't affect the logic in DECODE_FUNCTION - since each time that runs, it will run in a single thread from start to finish! Unless there are variables shared between executions?
Difficult to say more without more context around where invokeFunction is called and what the code in DECODE_FUNCTION is!
sandbox.setMaxCPUTime(1000);
sandbox.setMaxMemory(1024 * 1024 * 50L);
sandbox.setExecutor(Executors.newFixedThreadPool(2));
sandbox.eval(script);
I create two thread to run the follow:
Object object = sandbox.getSandboxedInvocable().invokeFunction(DECODE_FUNCTION, message);
My script can return two different result according to the params in message. But the return result are not int right order.
So I change the executor to Executors.newSingleThreadExecutor(). And the order is right. But reach the memory limit after run for a few time.
I guass is there any threading issues when executor has more than one thread? And the memory monitor calcute
inaccurete when the executor has one thread?
The text was updated successfully, but these errors were encountered: