10up / windows-azure-storage

Use the Microsoft Azure Storage service to host your website's media files.
https://wordpress.org/plugins/windows-azure-storage/
BSD 2-Clause "Simplified" License
64 stars 46 forks source link

Admin ajax infinite loop on action "get-azure-progress" #57

Open jorenvh opened 6 years ago

jorenvh commented 6 years ago

Hi

After the async upload call is processed an ajax call is made to check the process of the upload. This call just keeps firing to infinity, I tested this on my current project and in a plain Wordpress installation, in both installs that call is fired to infinity.

The only difference I'm noticing between my production app and the plain Wordpress install is the response of the call.

My production app: always keeps hanging on 87% progress

{success: true, data: {progress: 87, current: 7, total: 8}} data : {progress: 87, current: 7, total: 8} current : 7 progress : 87 total : 8 success : true

En the plain install keeps returning -1

{success: true, data: {progress: -1, current: -1, total: -1}} data : {progress: -1, current: -1, total: -1} current : -1 progress : -1 total : -1 success : true

Besides that going on, the upload succeeds as expected. But something seems a bit off here.

If more info is required please let me know and I see if I can gather that info.

Joren

nprasath002 commented 6 years ago

Hi @jorenvh,

I was not able to reproduce both of the issues locally. Here are couple of scenarios i think it could happen

  1. Can you make sure your theme in production uses different filenames for all registered image sizes?

  2. Can you provide me the data[item_id] that is passed in the admin-ajax call?. -1 only happens if the transient keys are different from frontend and backend that saves upload progress. There is a minor difference on how the key is filtered but i suspect that might be not the case

jorenvh commented 6 years ago

Hi @nprasath002

  1. I can confirm that we are using different filenames for all registered image sizes.

  2. data[item_id]:o_1c8hs44mh1qf61a1r1rkl1vbvm3ab

Thanks Joren

tott commented 6 years ago

Hi @jorenvh ,

I also tried to reproduce the issue. Can you advise if you see this behavior with all kind of file types and sizes or if it may be limited to a specific pattern?

Thanks Thorsten

jorenvh commented 6 years ago

Hi @tott

I only tested with images, I tested with larger once (+/- 10MB) and smaller once (20BKB). I didn't notice any pattern I'm having it with every image I upload.

Thanks Joren

jorenvh commented 6 years ago

Hi All

Any update on this?

Thanks Joren

tott commented 6 years ago

Hi there, it seems the underlying issue was fixed in one of the recent WordPress versions. I am not able to reproduce the issue in versions 4.9.5 and above.

sujrara commented 5 years ago

We are facing the exact same issue in 4.9.8. Unable to find solution. ajax call is made to check the process of the upload and this call just keeps firing to infinity, there by increasing the CPU of the DB.

Also adding a mere 20mb image shoots DB CPU to 90%. Below slow query is generated several times only for one image upload.

SELECT cms_posts.ID FROM cms_posts WHERE 1=1 AND (((cms_posts.post_title LIKE ‘%https://ticketcms.azureedge.net/ticketcms/2019/05/IMG\\_4C700BD34A96-1-360×180.jpeg%’) OR (cms_posts.post_excerpt LIKE ‘%https://ticketcms.azureedge.net/ticketcms/2019/05/IMG\\_4C700BD34A96-1-360×180.jpeg%’) OR (cms_posts.post_content LIKE ‘%https://ticketcms.azureedge.net/ticketcms/2019/05/IMG\\_4C700BD34A96-1-360×180.jpeg%’))) AND cms_posts.post_type IN (‘post’, ‘page’, ‘attachment’, ‘freetext_template’, ‘featured_event’, ‘static_event_design’, ‘topic_text’, ‘topic_img’, ‘rakuten_banner’, ‘hot_words’, ‘notice’) AND (cms_posts.post_status = ‘publish’ OR cms_posts.post_status = ‘acf-disabled’ OR cms_posts.post_status = ‘future’ OR cms_posts.post_status = ‘draft’ OR cms_posts.post_status = ‘pending’ OR cms_posts.post_author = 1 AND cms_posts.post_status = ‘private’) ORDER BY cms_posts.post_title LIKE ‘%https://ticketcms.azureedge.net/ticketcms/2019/05/IMG\\_4C700BD34A96-1-360×180.jpeg%’ DESC, cms_posts.post_date DESC;

Any suggestion would be greatly appreciated.