Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #10505 Rebuild and repair can lead to malformed grouped JS files #10507

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from

Conversation

chris001
Copy link
Contributor

@chris001 chris001 commented Aug 22, 2024

Fixes #10505

Make other processes (web users) wait to read the grouped JS files until AFTER they're written out to disk.

Description

The function ConcatenateFiles() now prevents users from accessing the combined grouped JS files, until after they're added together and saved to disk. How does it accomplish this? It locks for exclusive access each grouped JS file, writes all its contents, then unlocks the file for any user's web browser to download and run.

Motivation and Context

There is a race condition on the grouped (combined) JS files, resulting in malformed JS files which fail run.

How To Test This

Test original code: bug:

  1. Admin, Quick Repair Rebuild, and to be sure, Clear JS cache.
  2. Trigger many requests to the login screen at the same time, with an AB Testing Tool, Load Testing Tool.
  3. Verify the integrity of the grouped JS files.
    This test will cause a race condition, as each user's Suite web process will build the grouped JS code files at the same time, and some of the JS code files could be malformed and fail to run, because each Suite is allowed to write to the same grouped JS code file at the same time, resulting in a Frankenstein JS code file that fails to run.

Test fixed code:
Same procedure as above.
After QRR (cleared JS grouped code file cache), no matter how many simultaneous users load the Suite login page, Suite should only build well formed grouped JS code files.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

…ed JS files

Make other processes (web users) wait to read the grouped JS files until AFTER they're completely concatenated and written out to disk.
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.

Rebuild and repair can lead to malformed grouped JS files
1 participant