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

IMAP - Replace locking system with a daemon or queue system #56

Open
r-a-y opened this issue Jun 23, 2014 · 1 comment
Open

IMAP - Replace locking system with a daemon or queue system #56

r-a-y opened this issue Jun 23, 2014 · 1 comment

Comments

@r-a-y
Copy link
Owner

r-a-y commented Jun 23, 2014

The current IMAP locking system is not 100% foolproof.

If the auto-connect option is off and a site has a ton of concurrent users per second (greater than 12) during the time when a new IMAP inbox connection is needed, a ton of duplicate IMAP connections will occur, which could cause duplicate posts. This could happen on a high-trafficked site, but for the majority of sites, this should be okay.

If your site suffers from this, use the "Automatically Reconnect?" setting to only initiate the IMAP connection from the RBE settings page, available in 1.0-RC5+.

Otherwise, using a daemon or a proper queue system would resolve these problems:

However, this increases the server requirements:

PHP-Daemon

  • PHP 5.3+
  • A POSIX compatible operating system (Linux, OSX, BSD)
  • POSIX and PCNTL Extensions for PHP

beanstalkd

  • beanstalkd installed on the box

I'm kind of dropping support for IMAP mode in favor of inbound email (#46). This is just a note if someone wants to help implement this via a plugin, which should be possible now that the IMAP locking functions are pluggable (see commit 2adc4d0).

@r-a-y r-a-y added this to the Future Release milestone Jun 23, 2014
@r-a-y r-a-y changed the title IMAP - Replace locking system with a daemon IMAP - Replace locking system with a daemon or queue system Dec 17, 2014
@r-a-y
Copy link
Owner Author

r-a-y commented Jul 25, 2016

For those using IMAP with RBE, I've created a small drop-in plugin so you can use a persistent object cache instead of the filesystem for IMAP's locking mechanism:
https://gist.github.com/r-a-y/3efa6fa0a4c51969ad023609cbc51f15

This is helpful if you are using your site on a load balancer.

I've only tested this with Memcached and the WP PECL Memcached Object Cache plugin:
https://github.com/tollmanz/wordpress-pecl-memcached-object-cache

To use this plugin, deactivate RBE, add the drop-in plugin in /wp-content/mu-plugins/ or activate as a regular plugin, and then reactivate RBE.

Other object cache plugins might work, but depending on the implementation, the code might need some modification.

I still recommend to use Inbound Mode if you are starting from scratch:
https://github.com/r-a-y/bp-reply-by-email/wiki/Starter-Guide#1-inbound-email-mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant