Skip to content

.NET Bug: MermaidRenderer fails when invoked in parallel #10457

@crickman

Description

@crickman

Describe the bug

MermaidRenderer uses the same temp-file location for all invocations. This results in file contention that leads to an IOException.

Message: 
System.IO.IOException : The process cannot access the file 'C:\Users\crickman\AppData\Local\Temp\mermaid_temp.html' because it is being used by another process.

  Stack Trace: 
FileSystem.DeleteFile(String fullPath)
MermaidRenderer.GenerateMermaidImageAsync(String mermaidCode, String filenameOrPath) line 117
...

To Reproduce
Steps to reproduce the behavior:

  1. Add a second sample to GettingStartedWithProcesses that invokes MermaidRenderer
  2. Run samples with parallel execution enavled

Expected behavior
Samples execute without exception. (Use a unique temporary file for each invocation)

Platform

  • Language: C#

Metadata

Metadata

Assignees

Labels

.NETIssue or Pull requests regarding .NET codebugSomething isn't workingexperimentalAssociated with an experimental featureprocessessamplessk team issueA tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)staleIssue is stale because it has been open for a while and has no activity

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions