This fixes the open bug #37 on Facebook::Graph bugs list #58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix socket leak: Replace AnyEvent::HTTP::LWP::UserAgent with LWP::UserAgent
The reason to replace AnyEvent and AnyEvent::HTTP::LWP::UserAgent based
requests with LWP::UserAgent, is because of stability. It seems that at least
on certain Linux systems AnyEvent::HTTP::LWP::UserAgent starts to leak
sockets. The socket leak will lead, that all the responses will start to fail.
The failure error message is "Could not fetch access token: No such device
or address at /app/local/lib/perl5/Facebook/Graph/AccessToken/Response.pm
line 24." - which doesn't tell that much, but is related that the request did
never leave, because opening a socket failed.
It would be nice to fix AnyEvent::HTTP::LWP::UserAgent in general for the
actual socket leak problem, but as the Facebook::Graph module is a dependency
for quite many business applications - it's imperative to use a stable HTTP
client. And as the Facebook::Graph module does not actually do anything
asynchronously, it's not required to use an async HTTP client - at least for
now.