Comments (5)
Update in case any one else happens to stumble across this one day. Instead of rewriting to use the Contentful REST API, we're going to use the GraphQL API instead. That solves the recursion "problem" in that it wont be necessary.
We're still not sure what caused the segfault, only that it occurs when we have the plugin enabled. The plugin's sole job was to make a couple of queries using the PHP SDK and then we would run a handful of methods on those returned objects.
Interestingly, we were trying to experiment with where exactly the fault was occurring and noticed it still happened even when the only thing we instantiated was the \Contentful\Delivery\Client
. Is there anything in that class that your team can think of that could potentially cause something like a segfault?
WP Engine is notorious for having "tuned" their platform in a way to increase performance, so I wouldn't be surprised if their configuration messes with things like caching objects, regardless if they follow PSR specs or not.
Cheers
from contentful.php.
Final update likely for a while here. Potential reproduction steps for anyone who may want try this out.
- Create a blank WP plugin and install the Contentful PHP SDK via Composer
- Include the autoload file and then add a hook to the
plugins_loaded
action. - Inside your callback function, instantiate the main
Client()
class used for making requests - Hammer your server a few hundreds times relatively quickly
- Watch for segfaults
This was essentially the setup we were using on WP Engine. Not sure really what exactly in the package it could be.
Having a little more breathing room now to look at it, I wonder if the withLowMemoryResourcePool()
would be a potential factor here. We definitely weren't handling enough requests for it to matter in terms of running out of memory, but I wonder if the extended cache pool setup was something that is unreliable on WPE servers.
It's all very strange and I would love to test it more but I personally don't have the extra resources or time to do that now.
Curious if anyone else has any thoughts, because I'm stumped ¯_(ツ)_/¯
Cheers
from contentful.php.
Hi @daronspence , there were a few issues in the past, mostly around self-referencing entries that caused out of memory/too much recursion, here are a couple - #278 , #105 . I guess they could cause segfaults.
However, the issues were fixed and verified a while ago, first can you make sure you are on the latest version? If that's true, try getting more information from WP Engine, I would expect an error behind the segfault - was it out of memory? If not, what error did it crash with?
We need a bit more information as I am not aware of any issues specific to WPEngine, or any issues that could cause segfaults under certain conditions.
from contentful.php.
Thanks @pgrigoruta for linking those. We were on the latest version, unfortunately.
Also unfortunate, WPE wasn't able to get a solid request on their end with all of the debugging tools running. We had it up for almost a full day and they weren't able to capture any of the 502 requests we were generating, but they could see in some log that it was indeed a segfault.
I knew you probably didn't have a secret patch up your sleeve, but it never hurts to ask :)
Eventually we'll get this in front of them again and have them debug it more.
Cheers
from contentful.php.
Thanks @daronspence , I will close this for now as we don't have enough data to move forward, feel free to re-open if you find out more.
from contentful.php.
Related Issues (20)
- BaseClient::messages memory exhaustion HOT 3
- Allow specifying timeouts for API requests
- Support for Tags HOT 3
- Support for HTML Serializing of Rich Text fields HOT 2
- Empty Paragraph Node HOT 2
- Filtering not working on preview API HOT 3
- Version 6.2.0 contains BC breaks HOT 6
- Library not compatible with Google Auth because of not supporting PSR Cache in version 2 HOT 3
- Nested assets not returned for $entry->all(); HOT 3
- Serializable interface deprecated in PHP 8.1 HOT 3
- Contentful Delivery $setLocale * not working as expected HOT 6
- Deprecation warnings in PHP 8.1 HOT 13
- Soft Line Returns Not Rendered to HTML HOT 3
- Client::getEntries() cache does not work properly with different locales HOT 2
- psr/log require mismatch with Magento 2.4.4-p2 HOT 5
- PHP 8.2 HOT 1
- Doesn't return content, links, images and fields when serializing HOT 1
- I have a problem when updating php 8 that is defining the return type with Contentful\Delivery\Resource\Entry
- Update support for php 8.2/8.3? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contentful.php.