JeringTech / Javascript.NodeJS

Invoke Javascript in NodeJS, from C#
Other
463 stars 43 forks source link

Exception: "The semaphore has been disposed" on release 7.0.0 #185

Open ahmedmansour-geotab opened 11 months ago

ahmedmansour-geotab commented 11 months ago

NodeJs version: 16.13.2 Dotnet version: 7.0 Jering.Javascript.NodeJS package version: 7.0.0 Exception:

Exception: System.ObjectDisposedException EX59B6DA22 Message: The semaphore has been disposed. StackTrace: at System.Threading.SemaphoreSlim.CheckDispose() at System.Threading.SemaphoreSlim.Release(Int32 releaseCount) at Jering.Javascript.NodeJS.OutOfProcessNodeJSService.OutputReceivedHandler(String message, DisposeTrackingSemaphoreSlim semaphoreSlim) at Jering.Javascript.NodeJS.OutOfProcessNodeJSService.\u003c\u003ec__DisplayClass49_0.\u003cCreateAndSetUpProcess\u003eb__1(String message) at Jering.Javascript.NodeJS.NodeJSProcess.OutputThreadStart(Object arg) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

I see issue (152) mentions the fix was released in version 7.0.0. However, we encountered this error in production when we upgraded from 6.3.1 to 7.0.0.

JeremyTCD commented 11 months ago

Could you reproduce the error with debug logging enabled?

ahmedmansour-geotab commented 11 months ago

Do you mean with .AddLogging() added to the StaticNodeJSService.SetServices? Would that log to the console?