Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Unwanted behaviour on Zend\Http\Client eq not thread safe #30

Open
muhammedeminakbulut opened this issue Nov 10, 2015 · 3 comments
Open

Comments

@muhammedeminakbulut
Copy link

Hi,

We are using our application with around 25 workers (with beanstalkd and 25 listening proccesses). Most of the time we use the Client object to retrieve external content. And we do mime type checks which uses the headers.

Some of the use cases have setStream used.

And some times it will occur that the stream which is set by Client is the same filename used by another proccesses Client object. So we get a json mime type for an xml file by example.

It seems to go wrong on line 691 in \Zend\Http\Client object where tempnam is used. And as we can read from the documentation it is not really save to use.

http://php.net/manual/en/function.tempnam.php#98232

I suppose we should be using setStream with an own unique filename for each process to be safe. But that would be a workaround on the issue.

Thanks!

@Maks3w
Copy link
Member

Maks3w commented Nov 10, 2015

You could define a different config streamtmpdir for each process

@muhammedeminakbulut
Copy link
Author

We've tried that just now. But we keep getting an content type thats not correct.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-http; a new issue has been opened at laminas/laminas-http#23.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants