Page MenuHomePhabricator

Consider removing Microsoft Windows Cache (wincache) support
Closed, ResolvedPublic

Description

Microsoft Windows Cache aka wincache is IIS's answer to apcu. It has been supported in MediaWiki for object caching since T24844: Support Microsoft Windows Cache aka WINCACHE.

In recent years, this software appears to have fallen into disuse. Both the GitHub repo and PECL package are either listed as archived or inactive for almost a decade. There is a SourceForge repo which hosts no sources and has also been inactive since 2020. The official PHP docs note that WinCache is unsupported as of PHP 8; some user-driven builds have popped up but these also seem to have stopped working with more recent PHP 8.x versions.

As MediaWiki is preparing to raise the minimum required PHP version to 8.1, this is probably a good time to consider removing WinCache-related code from MediaWiki.

Acceptance Criteria

  • WinCache related code is either removed from MediaWiki or a decision is made to keep and maintain it.

Details

Related Changes in Gerrit:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1035358 had a related patch set uploaded (by TK-999; author: TK-999):

[mediawiki/core@master] [DNM] objectcache: Remove WinCache support

https://gerrit.wikimedia.org/r/1035358

Looks good to me. My only worry is that this can still be used in some instances with older versions. I'm wondering is it worth to extract just WinCacheBagOStuff to a separate small library and let people install it with composer if they really need it.

Before hard removal, first we should do a hard deprecation, - wfDeprecated() call in WinCacheBagOStuff constructor and update the ObjectCacheFactory:: getLocalServerCacheClass() to not use fallback to WinCacheBagOStuff when ACPU is not defined.

cc @Krinkle - do you have any thoughts on this matter ?

Looks good to me. My only worry is that this can still be used in some instances with older versions. I'm wondering is it worth to extract just WinCacheBagOStuff to a separate small library and let people install it with composer if they really need it.

Before hard removal, first we should do a hard deprecation, - wfDeprecated() call in WinCacheBagOStuff constructor and update the ObjectCacheFactory:: getLocalServerCacheClass() to not use fallback to WinCacheBagOStuff when ACPU is not defined.

cc @Krinkle - do you have any thoughts on this matter ?

So I was thinking that we might be able to skip the regular deprecation process here, as the extension is already incompatible with newer PHP—so once MediaWiki ups the PHP version requirement, we could remove the code without further ado, as it should not be possible to setup that version of MediaWiki at all on a PHP version that works with wincache. What do you think?

Looks good to me. My only worry is that this can still be used in some instances with older versions. I'm wondering is it worth to extract just WinCacheBagOStuff to a separate small library and let people install it with composer if they really need it.

Before hard removal, first we should do a hard deprecation, - wfDeprecated() call in WinCacheBagOStuff constructor and update the ObjectCacheFactory:: getLocalServerCacheClass() to not use fallback to WinCacheBagOStuff when ACPU is not defined.

cc @Krinkle - do you have any thoughts on this matter ?

So I was thinking that we might be able to skip the regular deprecation process here, as the extension is already incompatible with newer PHP—so once MediaWiki ups the PHP version requirement, we could remove the code without further ado, as it should not be possible to setup that version of MediaWiki at all on a PHP version that works with wincache. What do you think?

This is already specifically relevant for MW-1.42-release (as we bumped the min PHP requirement to 8.1.0+); we should probably at least merge some sort of annotation patch to master (and backport). But similarly, 1.39, 1.40 and 1.41 should (mostly) run on PHP 8.1(+), so is relevant there too.

Looks good to me. My only worry is that this can still be used in some instances with older versions. I'm wondering is it worth to extract just WinCacheBagOStuff to a separate small library and let people install it with composer if they really need it.

People running on older versions of PHP 7 might indeed be using php-wincache. However, it appears php-wincache is abandoned upstream and is incompatible with PHP 8 (per task description).

We're currently developing MW 1.43. Anyone running an previous releases of MediaWiki is not affected until they upgrade, as we will not backport these changes to older release branches. When we release removal of WinCache support in MW 1.43, they will have to run PHP 8 since MW 1.43 does not support PHP 7.x anymore. As such, they can't be using WinCacheBagOStuff. It wouldn't work with or without that class.

The most important thing, I think, is to make sure that when existing installs upgrade, they will either automatically use php-apcu (if they have that installed), or automatically use no local-server cache (if they have no local-server cache service installed). That it, it should not produce an error, but instead do the same thing that MediaWiki would do on a fresh install. Note that MediaWiki does not require a local-server cache. Both php-apcu and php-wincache are optional.

[…]

The most important thing, I think, is to make sure that when existing installs upgrade, they will either automatically use php-apcu (if they have that installed), or automatically use no local-server cache (if they have no local-server cache service installed). That it, it should not produce an error, but instead do the same thing that MediaWiki would do on a fresh install. Note that MediaWiki does not require a local-server cache. Both php-apcu and php-wincache are optional.

Mate's patch achieves this by registering wancache as an alias for CACHE_ACCEL, thus existing installs when they upgrade, will automatically select either php-apcu (if installed) or empty (default/no cache), the same way a new installation would.

Krinkle triaged this task as Medium priority.Sep 3 2024, 11:29 PM
Krinkle added a project: Technical-Debt.
Krinkle moved this task from Unsorted to Needs removal on the Technical-Debt board.

Change #1035358 merged by jenkins-bot:

[mediawiki/core@master] objectcache: Remove WinCache support

https://gerrit.wikimedia.org/r/1035358

Krinkle claimed this task.

Between the filing of this task and the actual removal, the extension did see a release, version 2.0.0.9 beta, which claims to make it compatible with PHP 8.1+. So while it may be true that it has fallen into disuse, the statement that it’s not compatible with MW 1.43 anyway due to PHP version constraints, isn’t true anymore. So I think it should be restored for MW 1.43 (and deprecated if you want).