Giter Club home page Giter Club logo

Comments (5)

daronspence avatar daronspence commented on June 12, 2024

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.

daronspence avatar daronspence commented on June 12, 2024

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.

pgrigoruta avatar pgrigoruta commented on June 12, 2024

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.

daronspence avatar daronspence commented on June 12, 2024

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.

pgrigoruta avatar pgrigoruta commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.