Rhino Compute - Python API Error

I am spinning up compute locally from the latest commit on the master branch.
When using python’s compute_rhino3d I get an error in NancyPipelineExtensions.cs

The error is

" [Cannot access a closed Stream] at System.IO.__Error.StreamIsClosed() at System.IO.MemoryStream.get_Length() at compute.frontend.RequestLogEnricher.Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) \\compute.rhino3d\\src\\compute.frontend\\NancyPipelineExtensions.cs:line 149\r\n at Serilog.Core.Logger.Dispatch(LogEvent logEvent)"

Wrapping this in a try-catch block bypasses the problem for now…

var stream = new MemoryStream();
try
{
	ctx.Response.Contents.Invoke(stream);
	logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty(
		"ResponseContentLength", stream.Length));
}
catch
{
	stream.Dispose();
}

@will or @brian, have you seen this behavior with the logging code? I’m not too familiar with it.

Hey Sherif, I have seen this very occasionally, but only while testing locally. If you open a pull request with your fix I’ll get it merged :+1:

Do we actually understand what is happening here? I would rather not mask a problem with a try/catch block.