reverbdotcom / reverb-magento

Magento 1.x plugin for syncing with Reverb
Other
7 stars 10 forks source link

Some items get stuck in a queue #240

Closed zztimur closed 8 years ago

zztimur commented 8 years ago

Log is full of messages such as below. If item is not enabled for sync it should probably be just removed from queue. Thoughts?

An exception occurred while syncing Reverb listing for product with sku XXXX: The "Sync to Reverb" value for this product has been set to "No"; this product can not be synced to Reverb as a result

dunagan5887 commented 8 years ago

I could catch that particular exception and decline to log the message

zztimur commented 8 years ago

This is how I see the problem. items that were "Sync to reverb" - true Then switched to sync to reverb false. They still sit in queued tasks.

Why would that be?

On Apr 27, 2016, at 11:18 AM, Sean Dunagan notifications@github.com wrote:

I could catch that particular exception and decline to log the message

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

dunagan5887 commented 8 years ago

When a product is saved or ordered, a background task is created to sync the listing to Reverb. No check is done on the "Sync To Reverb" value at this point. Only once the background task is being executed is the check made to see if the product is "Sync To Reverb"

This decision was made as a performance consideration when an admin triggers a bulk product sync. If 10,000 products are synced, not checking the "Sync To Reverb" value removs 10,000 database queries

zztimur commented 8 years ago

Sean, is there a way to chat with you?

On Apr 27, 2016, at 12:29 PM, Sean Dunagan notifications@github.com wrote:

When a product is saved or ordered, a background task is created to sync the listing to Reverb. No check is done on the "Sync To Reverb" value at this point. Only once the background task is being executed is the check made to see if the product is "Sync To Reverb"

This decision was made as a performance consideration when an admin triggers a bulk product sync. If 10,000 products are synced, not checking the "Sync To Reverb" value removs 10,000 database queries

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

dunagan5887 commented 8 years ago

My earliest availability is likely 3PM, I have calls schedule until then

zztimur commented 8 years ago

What's the best way to reach you?

On Apr 27, 2016, at 1:37 PM, Sean Dunagan notifications@github.com wrote:

My earliest availability is likely 3PM, I have calls schedule until then

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

zztimur commented 8 years ago

I'll call you at 3p

On Apr 27, 2016, at 1:43 PM, Sean Dunagan notifications@github.com wrote:

Cell: 708-508-0047

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

dunagan5887 commented 8 years ago

Sounds good

kylecrum commented 8 years ago

Let us know what you guys come up with for possible solutions.

dunagan5887 commented 8 years ago

I'm going to catch the specific exception which is thrown in this case. Upon catching the exception I will set the task to be in ABORTED state to prevent it from being re-tried. No log messages will be logged in this event

kylecrum commented 8 years ago

@dunagan5887 does that mean you are querying before every job in the queue is run? Or is there an abort exception if the tasks in the queue are aborted?

dunagan5887 commented 8 years ago

The specifications are that any time a listing sync queue task is executed, the product is loaded from the database. At this point the check is made to see if the Product is set to be Synced with Reverb. If not, a Reverb_ReverbSync_Model_Exception_Product_Excluded is thrown (this exception is also currently thrown if the product is not a simple or configurable product).

I will catch this Reverb_ReverbSync_Model_Exception_Product_Excluded exception and set the task to be ABORTED

zztimur commented 8 years ago

What's been happening before is the following: 1) on product is saved, product is added to the processing queue 3) every X mins (5 currently) that product would be checked if it's set to sync to reverb, if not-exception is thrown and its logged.

So we were getting thousand of products queried every five mins, if they are set to sync with reverb and logged the outcome.

Which is bloating the log files and making those unnecessary db queries, you were trying to avoid in the first place

On Apr 27, 2016, at 3:27 PM, Sean Dunagan notifications@github.com wrote:

The specifications are that any time a listing sync queue task is executed, the product is loaded from the database. At this point the check is made to see if the Product is set to be Synced with Reverb. If not, a Reverb_ReverbSync_Model_Exception_Product_Excluded is thrown (this exception is also currently thrown if the product is not a simple or configurable product).

I will catch this Reverb_ReverbSync_Model_Exception_Product_Excluded exception and set the task to be ABORTED

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

kylecrum commented 8 years ago

👍