IMPB-1512 Mitigate OOM errors by maintaining a smaller array of properties to return from client_properties() when possible#499
Open
lainvineyard wants to merge 1 commit intoidxbroker:release/3.1.0from
Conversation
…eturn from client_properties when possible Reduce possibility of running into an OOM error by doing the following: $max number of listings needed for the widget is used to limit the number of returned listings to that number $user_agent_id is used to proactively filter listings out of the results $max_sort is used together with $max to ensure the correct ordering of results is returned when low-high, high-low is set Added 'none' as a sort order option for shortcodes if the order of the returned listings does not matter. Using none for the sort order lets the plugin return results much faster. Note that functionality when 'default' is used for the sort order is kept the same to avoid disrupting the functionality of shortcode already being used on sites.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Requests
Please explain the intent of your Pull Request.
🐛 Are you fixing a bug? Y
💻 Are you changing functionality? Y
Template
Description of the Change
A client was encountering OOM errors when trying to use the 'soldpending' property type option with the IMPress shortcodes. Investigating the situation, it was determined that this is happening because of the current behavior of the plugin where it loads all possible sold/pending listings even when only a part of them are necessary. The large number of listings associated with the account was thereby causing the issue.
The changes in this PR add optional arguments to /idx/idx-api.php client_properties() that, when used, allow for the plugin to maintain a smaller rolling list of properties that match what is needed to output the correct listings for the given request.
Note that the functionality when the "default" sort order is set is left unchanged in case there are clients that are intentionally retrieving all the listings at once for these widgets. This means a high-low, low-high or 'none' sort order will have to be set to see the changes in effect.
Verification Process
[impress_property_carousel property_type="soldpending" max="100" order="high-low" autoplay="0" styles="1" new_window="1" ]Release Notes
Fix: mitigated possibility of out of memory errors occurring when handling thousands of listings with the Showcase and Carousel widgets
Review
Pull Requests must have the sign-off of two other developers and at least one of these must be an IDX Broker team member.