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

Massive review and cleanup of JCache #9622

Merged
merged 2 commits into from
Apr 12, 2016
Merged

Massive review and cleanup of JCache #9622

merged 2 commits into from
Apr 12, 2016

Conversation

mbabker
Copy link
Contributor

@mbabker mbabker commented Mar 27, 2016

Unfortunately this PR does a lot. It started just trying to clean up some of the tests but then several bits of dead code and bug fixes were needed to, so...

Summary of Changes

This PR makes the following changes:

  • General changes
    • Creates an abstract TestCaseCache for all JCacheStorage handler tests and rewrites the test classes for those objects to use this test case (results in more consistent testing of all handlers when the environment supports it)
    • Standardizes doc blocks on all JCache classes for full consistency and removes some outdated or unneeded comments
    • Uses late static bindings where practical (enables better class inheritance)
  • Bug fixes
    • JCacheStorageMemcache::store() was manipulating the handler's lifetime setting after being instantiated
    • JCacheStorageRedis::store() was manipulating the handler's lifetime setting after being instantiated, had some dead code (copy/paste from Memcache(d) not needed here), and used a hardcoded lifetime instead of the handler's configured lifetime

Testing Instructions

@brianteeman
Copy link
Contributor

(a bit above my skill set but sounds like this might address some existing issues here https://issues.joomla.org/tracker/joomla-cms/?state=open&sort=issue&direction=desc&category=cache&stools-active=1 )


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9622.

@mbabker
Copy link
Contributor Author

mbabker commented Mar 27, 2016

#9382 is included in here. #8707 I've added the fix for (when JCache creates a handler the lifetime is already injected in as a constructor parameter and JCacheStorage handles conversion of minutes to seconds, as noted there this line just screws things up). Ironically #6796 also makes that same change based on #2539.

@brianteeman
Copy link
Contributor

Thanks for checking can you update those issues as needed

On 27 March 2016 at 19:12, Michael Babker notifications@github.com wrote:

#9382 #9382 is included in
here. #8707 #8707 I've added
the fix for (when JCache creates a handler the lifetime is already
injected in as a constructor parameter and JCacheStorage handles
conversion of minutes to seconds, as noted there this line just screws
things up). Ironically #6796
#6796 also makes that same
change based on #2539 #2539.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#9622 (comment)

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

@brianteeman
Copy link
Contributor

@mbabker I have updated the other issues. Thanks for reviewing them

@andrepereiradasilva
Copy link
Contributor

I have tested this item ✅ successfully on 9228a86

Wow that's really a massive review!

Did a code review (except the unit tests) and all seems fine.

Installed the patch turned on File cache and all seems fine.

Didn't test all the other cache handlers, but by looking at code changes, it seems fine and also corrects some bugs.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9622.

@alikon
Copy link
Contributor

alikon commented Mar 29, 2016

i've tested successfully using only the redis handler

@Kubik-Rubik
Copy link
Member

@alikon Please use the Joomla! issue tracker to enter your test result. Thanks!

@Kubik-Rubik Kubik-Rubik added this to the Joomla 3.5.2 milestone Mar 29, 2016
@alikon
Copy link
Contributor

alikon commented Mar 29, 2016

I have tested this item ✅ successfully on 9228a86

Tested on Redis cache handler


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9622.

@brianteeman
Copy link
Contributor

RTC thanks


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9622.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 31, 2016
@rdeutz rdeutz merged commit 6b98303 into joomla:staging Apr 12, 2016
@mbabker mbabker deleted the Cache-Test-Cases branch April 12, 2016 20:40
@rdeutz rdeutz modified the milestones: Joomla 3.5.2, Joomla! 3.6.0 May 1, 2016
@brianteeman brianteeman removed the RTC This Pull Request is Ready To Commit label May 11, 2016

$memcachetest = @self::$_db->connect($server['host'], $server['port']);
$memcachetest = @static::$_db->connect($server['host'], $server['port']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is incorrect!
$server is not defined, $memcachetest return false, and below throw exception.

This is reason why travis on PR #11576 failed.
https://travis-ci.org/joomla/joomla-cms/jobs/151946004

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Oops.

On Saturday, August 13, 2016, Tomasz Narloch notifications@github.com
wrote:

In libraries/joomla/cache/storage/memcache.php
#9622 (comment):

  •   $memcachetest = @self::$_db->connect($server['host'], $server['port']);
    
  •   $memcachetest = @static::$_db->connect($server['host'], $server['port']);
    

This line is incorrect!
$server is not defined, $memcachetest return false, and below throw
exception.

This is reason why travis on PR #11576
#11576 failed.
https://travis-ci.org/joomla/joomla-cms/jobs/151946004


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/joomla/joomla-cms/pull/9622/files/9228a8674c558e12d6af931e2b8785effa1bbbb8#r74692172,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWfoYsotSVZ4Tb6QFw_5WMQsQW3pRhqks5qfi8sgaJpZM4H5gT6
.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this fixed somewhere or do we have to fix it, just curious.

@csthomas
Copy link
Contributor

It is fixed at #11565.

@rdeutz
Copy link
Contributor

rdeutz commented Aug 18, 2016

@csthomas Thanks!

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.

8 participants