Skip to content

Quick change to disable synchronous calculation of resource size#3090

Merged
bjester merged 2 commits intolearningequality:hotfixesfrom
bjester:disable-sync-resource-size-calc
Apr 12, 2021
Merged

Quick change to disable synchronous calculation of resource size#3090
bjester merged 2 commits intolearningequality:hotfixesfrom
bjester:disable-sync-resource-size-calc

Conversation

@bjester
Copy link
Member

@bjester bjester commented Apr 12, 2021

Summary

Synchronous calculations of resource size are taking too long.

Description of the change(s) you made

Changes the constant used to determine whether it should try calculation synchronously or not such that it shouldn't try to do so

Manual verification steps performed

  1. Open a small channel
  2. Click Publish
  3. You should observe a loading spinner until the resource size task completes
  4. Verify you see the channel size once it does complete

References

Addresses: #3084
Follow up: #3089
Gherkin: integration_testing/features/publish-channel.feature


Contributor's Checklist

  • Code is clean and well-commented
  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Any new interactions have been added to the QA Sheet
  • Critical and brittle code paths are covered by unit tests

Reviewer's Checklist

This section is for reviewers to fill out.

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@bjester bjester requested a review from rtibbles April 12, 2021 20:29
@bjester bjester added this to the Sprint 2021-04-12 milestone Apr 12, 2021
@codecov
Copy link

codecov bot commented Apr 12, 2021

Codecov Report

Merging #3090 (367e008) into hotfixes (7ddca73) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           hotfixes    #3090      +/-   ##
============================================
- Coverage     85.96%   85.96%   -0.01%     
============================================
  Files           305      304       -1     
  Lines         16478    16474       -4     
============================================
- Hits          14166    14162       -4     
  Misses         2312     2312              
Impacted Files Coverage Δ
...curation/contentcuration/tests/utils/test_nodes.py 95.23% <100.00%> (+0.04%) ⬆️
...contentcuration/tests/viewsets/test_contentnode.py 84.97% <100.00%> (+0.01%) ⬆️
contentcuration/contentcuration/utils/nodes.py 83.81% <100.00%> (ø)
...tentcuration/migrations/0123_auto_20210407_0057.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ddca73...367e008. Read the comment docs.

@bjester bjester merged commit 516d79d into learningequality:hotfixes Apr 12, 2021
@pcenov
Copy link
Member

pcenov commented Apr 13, 2021

@bjester, after testing this change I can confirm that the the channel size is displayed now in the modal window. However for some reason it takes a lot of time before that happens even for a very small channel and I have an excellent internet connection.
For example I created a channel with just a single small imported resource (token: nozak-rugol) and it still took about 2 minutes of waiting before the size of the channel was calculated and displayed.

2021-04-13_14-58-56

@radinamatic
Copy link
Member

Confirming the findings by @pcenov: it takes almost 2 minutes to get the channel size calculated and for spinner to disappear on both channel with 82 resources and the one with just 2 resources 🤔

@bjester
Copy link
Member Author

bjester commented Apr 15, 2021

@pcenov @radinamatic Thank you for your testing insights! That is indeed a longer wait than expected. This change removed the synchronous calculation which forces the calculation to be queued for our async task workers. If there are a lot of tasks in the queue, that will slow down the processing, which is difficult to get a realistic read in a local development environment. Therefore it does seem that we should reinstate synchronous processing, but we should decrease the threshold from 5000 resources. I'll plan a follow up for next release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants