PHP Developers Network
http://forums.devnetwork.net/

Issues while running under multiple processes - 4.0.0-b5
http://forums.devnetwork.net/viewtopic.php?f=52&t=95370
Page 1 of 1

Author:  KevinC [ Mon Feb 16, 2009 11:43 am ]
Post subject:  Issues while running under multiple processes - 4.0.0-b5

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

Author:  Chris Corbyn [ Mon Feb 16, 2009 8:52 pm ]
Post subject:  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.

Author:  KevinC [ Mon Feb 16, 2009 10:01 pm ]
Post subject:  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

Author:  Chris Corbyn [ Mon Feb 16, 2009 10:13 pm ]
Post subject:  Re: Issues while running under multiple processes - 4.0.0-b5

Thanks Kevin, I'll try to replicate this and pin down the cause.

Author:  intermesh [ Tue Apr 07, 2009 5:17 am ]
Post subject:  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()

Author:  Chris Corbyn [ Tue Apr 07, 2009 5:48 am ]
Post subject:  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?

Author:  Chris Corbyn [ Tue Apr 07, 2009 5:56 am ]
Post subject:  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.

Author:  Hocker [ Sun Jun 21, 2009 12:52 pm ]
Post subject:  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%.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/