When running the drush bot-start command, using nohup, the bot eventually dies, with an error stating that no memory could be allocated:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 24 bytes) in /var/aegir/drush/includes/backend.inc on line 120
CommentFileSizeAuthor
#8 bot-1013458-8.patch9.94 KBq0rban

Comments

dave reid’s picture

I've also ran into this several times when running the bot from drush

q0rban’s picture

BTW, this is PHP 5.2.6-1, drush 3.1, and Pressflow 6.19.96

morbus iff’s picture

@Dave: what version of PHP, Drush, and bot?

morbus iff’s picture

At this point, it's gonna be tough for me to help you all debug/fix it, since the only version of Drush I've personally run is Drush 4.x, PHP 5.3.x, under bot-7.x-dev (which has a different Drush patch then q0rban's latest, which DOES DO a backend invoke for status updates, which is what the above error points to).

morbus iff’s picture

(This is the patch I'm running, which won't be a drop-in replacement - line 40 needs to be tweaked/removed.)

q0rban’s picture

Status: Active » Postponed (maintainer needs more info)

For the record, Dave Reid and I are both not using the version of the drush command that was actually committed. I will update to the committed version and test with that.

q0rban’s picture

Nevermind, not really possible to use the committed command, as it has only been committed for 7.x, and not trivial to backport.

q0rban’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new9.94 KB

Here's an updated version of the bot daemon that implements drushd. This is a patch against 6.x-1.x-dev. You must have drushd, which can be found at https://github.com/q0rban/drushd

drushd will restart the process if it reaches 85% of ram, which will mean you may see your bot disappear for a few seconds and then re-appear. But it may never need to, since this will reduce memory leaks as well, as it no longer uses drush_backend_invoke.

morbus iff’s picture

As a general FYI to onlookers, it is unlikely that drushd support will become part of the core 7.x release, as 7.x doesn't exhibit the memory exhaustion that prompted this "needs to be restarted regularly" approach (which is also rectified, without drushd, in 7.x's scripts/bot_check.sh).

morbus iff’s picture

Title: Drush command eventually eats up all available memory » drushd patch for 6.x

I'll keep this ticket open for awhile, for visibility's sake.

morbus iff’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

q0rban’s picture

Status: Closed (fixed) » Closed (won't fix)

This is a more accurate status.