PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun Sep 27, 2020 8:46 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Mon Feb 16, 2009 11:43 am 
Offline
Forum Newbie

Joined: Sun Feb 15, 2009 1:01 pm
Posts: 8
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


Top
 Profile  
 
PostPosted: Mon Feb 16, 2009 8:52 pm 
Offline
Breakbeat Nuttzer
User avatar

Joined: Wed Mar 24, 2004 8:57 am
Posts: 13098
Location: Melbourne, Australia
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.


Top
 Profile  
 
PostPosted: Mon Feb 16, 2009 10:01 pm 
Offline
Forum Newbie

Joined: Sun Feb 15, 2009 1:01 pm
Posts: 8
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


Top
 Profile  
 
PostPosted: Mon Feb 16, 2009 10:13 pm 
Offline
Breakbeat Nuttzer
User avatar

Joined: Wed Mar 24, 2004 8:57 am
Posts: 13098
Location: Melbourne, Australia
Thanks Kevin, I'll try to replicate this and pin down the cause.


Top
 Profile  
 
PostPosted: Tue Apr 07, 2009 5:17 am 
Offline
Forum Newbie

Joined: Tue Apr 07, 2009 5:14 am
Posts: 1
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()


Top
 Profile  
 
PostPosted: Tue Apr 07, 2009 5:48 am 
Offline
Breakbeat Nuttzer
User avatar

Joined: Wed Mar 24, 2004 8:57 am
Posts: 13098
Location: Melbourne, Australia
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?


Top
 Profile  
 
PostPosted: Tue Apr 07, 2009 5:56 am 
Offline
Breakbeat Nuttzer
User avatar

Joined: Wed Mar 24, 2004 8:57 am
Posts: 13098
Location: Melbourne, Australia
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.


Top
 Profile  
 
PostPosted: Sun Jun 21, 2009 12:52 pm 
Offline
Forum Newbie

Joined: Wed Mar 25, 2009 10:54 am
Posts: 3
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%.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group