-
Notifications
You must be signed in to change notification settings - Fork 91
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
UnauthorizedAccessException if multiple pile instances are used on one server #45
Comments
Did you set I'd set it up like so, where PILEDATA is global env var (or hower u have your server setup):
|
Hello, |
DirectoryRoot can be the same, differentiate your instances using |
Hello, we already use a different name and directory for the pile. The problem seems that the pile segments have the same name for different instances. When we manually change the var tempPath = Path.GetTempPath() + Guid.NewGuid();
var tempPath2 = Path.GetTempPath() + Guid.NewGuid();
foreach (var tempDir in new[] { tempPath, tempPath2 })
{
Directory.CreateDirectory(tempDir);
}
var pile1 = new MMFPile("pile1")
{
DataDirectoryRoot = tempPath,
AllocMode = AllocationMode.ReuseSpace
};
var pile2 = new MMFPile("pile2")
{
DataDirectoryRoot = tempPath2,
AllocMode = AllocationMode.ReuseSpace
};
pile1.Start();
pile2.Start();
var result = pile1.Put("");
var result2 = pile2.Put("xxx"); |
Not sure where the problem is in your example. The DataDirectory is concat with instance name. Just set different name.not sure why it does not work for your case
|
@ptr1120 are you saying that dir name/path does not matter and files cannot have the same NAME even IF they are in different directories? |
thanks. |
We experienced an issue with 2 separate pile instances are used in different appPools (IIS). Both applications are using different pile locations.
This seems to be caused by not unique names of the pile segments. The method
MMFMemory.MakeFilename
should generate unique filenames.When we change the
MMF_PREFIX
manually to a random string there aren't any issues anymore.That's why we think map-name of the memory-mapped-file with a static suffix+prefix causes this problem. A map-name should be used only once on the whole server.
Best regards,
Peter
The text was updated successfully, but these errors were encountered: