Skip to content

[SE-3401] Webpack Hashes to use Md5Hash Plugin to be consistent among multiple instances - #268

Closed
nizarmah wants to merge 2 commits into
opencraft-release/juniper.3from
nizar/temporary_fix_multiple_instances_webpack_juniper_3_backport
Closed

[SE-3401] Webpack Hashes to use Md5Hash Plugin to be consistent among multiple instances#268
nizarmah wants to merge 2 commits into
opencraft-release/juniper.3from
nizar/temporary_fix_multiple_instances_webpack_juniper_3_backport

Conversation

@nizarmah

@nizarmah nizarmah commented Oct 3, 2020

Copy link
Copy Markdown

There is a small bug that started happening in Juniper related to webpack's cached files, where the hashes were not consistent on different machines and would change on every assets update. Accordingly, this caused 404 errors with multiple instances and load balancers, which made the Studio and LMS unusable.

Some examples of the Studio and LMS being unusable:

  • Studio would load but no courses would be populated
  • LMS would load but no units would load in
  • Any functionality relying on JavaScript became unusable (such as XBlocks and XModules)

In order to solve this issue, I've created 2 different pull requests.

  1. Temporary Fix: Using MD5 Hash Plugin to hash files ([SE-3401] Webpack Hashes to use Md5Hash Plugin to be consistent among multiple instances #268)
  2. Long Term Fix: Using Webpack's Content Hash and Upgrading Webpack to v4.44.2 ([SE-3401] Upgrades Webpack to v4.44.2 to support content hashing #265)

The reason for a temporary fix is because a long term one might have a longer review process than desired. So the issue would be fixed in the meantime, but a better fix would be merged later on.

JIRA tickets: SE-3401

Sandbox URL:

Testing instructions:

  1. Spawn multiple instances and add to load-balancer.
  2. Open the Developer console for the LMS and Studio and verify there are no 404 messages for commons.js.
  3. SSH into the different instances and verify that the output for ls /edx/var/edxapp/staticfiles/studio/bundles/ | grep -i commons is the same among the different instances.
  4. Compare the files in /edx/var/edxapp/staticfiles/studio/bundles/ and /edx/var/edxapp/staticfiles/bundles/ between both App Servers and make sure they have the same filename (including hashes).
  5. Compare the files in /edx/var/edxapp/staticfiles/studio/bundles/ and /edx/var/edxapp/staticfiles/bundles/ between app servers with old instances (without the fix) and new ones (with the fix) and make sure everything is similar/acting normal.
  6. Verify that the assets are getting loaded correctly.

Reviewers

@nizarmah nizarmah closed this Oct 6, 2020
@nizarmah

nizarmah commented Oct 6, 2020

Copy link
Copy Markdown
Author

Closed pull request because commit 1b709c1958f68bd096053b2c9f2be75f06d7d57a solves the issue.

@nizarmah
nizarmah deleted the nizar/temporary_fix_multiple_instances_webpack_juniper_3_backport branch October 7, 2020 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant