In our performance benchmarks test I occasionally see these errors:
-----
Warning: rmdir(C:\aaa\bbb\/499981cb74fa2): Directory not empty in D:\path_to_lib\classes\Swift\KeyCache\DiskKeyCache.php on line 264
PHP Warning: unlink(C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\1\/499981ef0d181/body): Permission denied in D:\path_to_lib\classes\Swift\KeyCache\DiskKeyCache.php on line 247
Warning: unlink(C:\aaa\bbb\/499981ef0d181/body): Permission denied in D:\path_to_lib\classes\Swift\KeyCache\DiskKeyCache.php on line 247
PHP Warning: rmdir(C:\aaa\bbb\/499981ef0d181): No such file or directory in D:\path_to_lib\classes\Swift\KeyCache\DiskKeyCache.php on line 264
-----
These are from a Windows Server running the Swiftmailer under multiple processes.
I believe I have also seen this under Linux.
This is only while stressing the library under multiple instances - and then we only see a couple of these errors.
(of course "\aaa\bbb" and "\path_to_lib" are substitutions)
Thanks,
Kevin
Issues while running under multiple processes - 4.0.0-b5
Moderators: Chris Corbyn, General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Issues while running under multiple processes - 4.0.0-b5
Hmm, that's odd and I'm not sure how that could happen. When you say under multiple processes, are how you doing this specifically? I'm wondering if there are collisions with the cache file name generation.
Re: Issues while running under multiple processes - 4.0.0-b5
Under windows we are running under multiple processes by running these php scripts from the command line and using multiple instances of "cmd" windows.
Under LINUX we simple fork the process to the background using a terminating "&". We then issue the batch command multiple times in a row.
In either case we have multiple instances of PHP & Swift Mailer running, each looping through the building of thousands of emails per minute.
Thanks,
Kevin
Under LINUX we simple fork the process to the background using a terminating "&". We then issue the batch command multiple times in a row.
In either case we have multiple instances of PHP & Swift Mailer running, each looping through the building of thousands of emails per minute.
Thanks,
Kevin
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Issues while running under multiple processes - 4.0.0-b5
Thanks Kevin, I'll try to replicate this and pin down the cause.
Re: Issues while running under multiple processes - 4.0.0-b5
This issue is still not solved in 4.0.3. When I send a mail from a script that is executed in the background on a command line with popen()
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Issues while running under multiple processes - 4.0.0-b5
Hmm... I think I can see the problem...
Swift uses paths that have a forward slash, which PHP should support on all platforms. However, the base path here seems to end with a backslash:
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\1\/499981ef0d181/body
Notice the "1\/499981ef0d181" part. I think that will mess with the script.
Out of curiosity, did you specify the temp path yourself, or are you just using Swift Mailer defaults?
Swift uses paths that have a forward slash, which PHP should support on all platforms. However, the base path here seems to end with a backslash:
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\1\/499981ef0d181/body
Notice the "1\/499981ef0d181" part. I think that will mess with the script.
Out of curiosity, did you specify the temp path yourself, or are you just using Swift Mailer defaults?
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Issues while running under multiple processes - 4.0.0-b5
I'm just looking at the code that clears the cache items, it doesn't try to do anything naive such as deleting the entire cache directory, it's namespaced by unique random keys and each cache item has a unique id too. The cache only deletes files it is authorative for.
One thing that would cause conflicts is using pcntl_fork() rather then popen() since, if I understand what pcntl_fork() does it will copy the same unique IDs etc into the forked process.
One thing that would cause conflicts is using pcntl_fork() rather then popen() since, if I understand what pcntl_fork() does it will copy the same unique IDs etc into the forked process.
Re: Issues while running under multiple processes - 4.0.0-b5
Well I am not running under multiple processes but can see the same message from time to time,
even if I use the script to send one email.
When sending batches it appears randomly, 90% of the time everything goes smoothly but I still get
the error on the other 10%.
even if I use the script to send one email.
When sending batches it appears randomly, 90% of the time everything goes smoothly but I still get
the error on the other 10%.