-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception not thrown for ZipFile inside Blazor-Server Service #62231
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/area-system-io-compression Issue DetailsDescriptionCreating an archive of a folder (in blazor), which contains a named pipe in DotNet 6.0 via the ZipFile Class causes the program to block indefinitely long, without any kind of exception thrown.
Configuration
Other informationAn Exception is thrown when I try to ZIP the same directory inside a simple Dotnet Console Application.
|
Hi @BuchholzTim Are you sure that you are using Accodring to mkfifo man page:
Moreover, the reading is finished when writer closes the file descriptor. |
I've tried to repro that, but I've failed. Here is the code that I've used: public async Task CanZipNamedPipe()
{
string destPath = Path.Combine(TestDirectory, "dest.zip");
string subFolderPath = Path.Combine(TestDirectory, "subfolder");
string fifoPath = Path.Combine(subFolderPath, "namedPipe");
Directory.CreateDirectory(subFolderPath); // mandatory before calling mkfifo
Assert.Equal(0, mkfifo(fifoPath, 438 /* 666 in octal */));
byte[] contentBytes = { 1, 2, 3, 4, 5 };
await Task.WhenAll(
Task.Run(() =>
{
using FileStream fs = new (fifoPath, FileMode.Open, FileAccess.Write, FileShare.Read);
foreach (byte content in contentBytes)
{
fs.WriteByte(content);
}
}),
Task.Run(() =>
{
ZipFile.CreateFromDirectory(subFolderPath, destPath);
using ZipArchive zippedFolder = ZipFile.OpenRead(destPath);
using Stream unzippedPipe = zippedFolder.Entries.Single().Open();
byte[] readBytes = new byte[contentBytes.Length];
Assert.Equal(contentBytes.Length, unzippedPipe.Read(readBytes));
Assert.Equal<byte>(contentBytes, readBytes);
Assert.Equal(0, unzippedPipe.Read(readBytes)); // EOF
}));
}
[DllImport("libc", SetLastError = true)]
private static extern int mkfifo(string path, int mode); @BuchholzTim Could you please share more details (repro, stack trace)? |
This issue has been marked |
This issue has been automatically marked |
This issue will now be closed since it had been marked |
Description
Creating an archive of a folder (in blazor), which contains a named pipe in DotNet 6.0 via the ZipFile Class causes the program to block indefinitely long, without any kind of exception thrown.
mkfifo
(for me this happened while running my dotnet application inside a docker conatiner)ZipFile.CreateFromDirectory
inside a Blazor-Server ServiceConfiguration
dotnet new blazorwasm -ho
)Other information
An Exception is thrown when I try to ZIP the same directory inside a simple Dotnet Console Application.
The text was updated successfully, but these errors were encountered: