-
-
What happens if RB is scaled across servers, and two handle the same request at the same time? Especially with in-extension upgrades.
Maybe instead of a file-based cache, we just do this with memcached?
-
Can we move this to the class definition?
Also, I'm not sure we want to key this off on media versions. I think we want a more general
_installed_version
or something, which we'd then use for handling any in-extension upgrading as well. -
I don't know that this will actually re-fetch from the database. Settings sync won't kick in while we're in a loop. I believe we're going to need to re-fetch the extension entry from the database.
-
Reinstall extension media when the version of the extension changes.
Review Request #5673 — Created April 3, 2014 and submitted
Upgrades for extensions which include static media (like javascript or CSS) are
highly annoying, because in addition to installing the package, the user has to
disable the extension, then re-enable it. This change fixes all that.When we install extension static media, we add a key to the extension settings
dictionary called_extension_media_version
. Then, when initializing the
extension class, if the version stored in settings doesn't match the one for
the running code, we'll re-install the media.This is fine and dandy for the single-threaded devserver, but it's possible
that installing a new extension could cause a bunch of threads/processes to try
to reinstall static media all at once on a production server. I've therefore
created a relatively simple locking mechanism to ensure that only one thread
will be installing media for any given extension at a time.Testing done:
- Enabled a new extension and saw the media get installed.
- Disabled an existing extension and re-enabled it, and saw media get installed.
- Restarted my devserver and saw that static media versions were checked, but no re-installation occurred.
- Updated the version of an extension, restarted the devserver, and saw that static media got upgraded.
- Created a lock contention and saw that initializing the extension waited for the lock to clear.
Description | From | Last Updated |
---|---|---|
What happens if RB is scaled across servers, and two handle the same request at the same time? Especially with … |
chipx86 | |
Can we move this to the class definition? Also, I'm not sure we want to key this off on media … |
chipx86 | |
I don't know that this will actually re-fetch from the database. Settings sync won't kick in while we're in a … |
chipx86 | |
If we pull the key out above, we can reuse it here. |
chipx86 |
- Commit:
-
3664e4402fafe95a7cc5d0e69e0250e1ba2f3188c1e787313984a3d54c02eb8c151afc6a84c4c3a5
- Diff:
-
Revision 2 (+71 -6)