[wp-hackers] Twitter Tools digest help

Otto otto at ottodestruct.com
Tue Nov 18 16:31:53 GMT 2008


You have a very edge case race condition regarding the
aktt_doing_digest_post option. You check it then do a whole bunch of
date checking stuff that takes a finite amount of time before you then
later set it to 1, to show that you're doing something, in another
function entirely. Because of this, it's possible for the digest to
run more than once on a high enough traffic site. All that has to
happen is two threads enter that check at pretty close to the same
time, and they'll both end up creating the digest.

If you are using an option as a mutex (not safe, but what is, eh?),
then you need to set the option more or less immediately after you
check it. This does not fix the race condition, but it does reduce its
impact. You also need to make certain that the option you use for that
has the autoload setting set to false, else one thread that started up
before you set it can have it cached and never reload it even after
you've set it.

Honestly, that whole thing on the shutdown action is weak anyway. Use
the event scheduler instead . Sure, it won't work when somebody's
wp-cron setup is broken, but lots of things won't work in those cases.
 http://codex.wordpress.org/Category:WP-Cron_Functions



On Tue, Nov 18, 2008 at 10:15 AM, Alex King <lists at alexking.org> wrote:
> Hello all--
>
> If anyone has some spare cycles to help out debugging some issues with the
> digest features in Twitter Tools, I'd be grateful:
>
> http://alexking.org/blog/2008/11/16/twitter-tools-digest-problems
>
> Cheers,
> --Alex
>
> Personal   http://alexking.org
> Business   http://crowdfavorite.com
> Schedule   http://alex.myfreebusy.com
>
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list