Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 92b2359

Browse files
authored
Remove respawn after 50% memory exhaustion during batch processing. (#3909)
1 parent 0af6535 commit 92b2359

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

includes/batch.inc

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,12 @@ class DrushBatchContext extends ArrayObject {
5252
* Process a Drupal batch by spawning multiple Drush processes.
5353
*
5454
* This function will include the correct batch engine for the current
55-
* major version of Drupal, and will make use of the drush_backend_invoke
56-
* system to spawn multiple worker threads to handle the processing of
57-
* the current batch, while keeping track of available memory.
55+
* major version of Drupal, and will make use of the site-process
56+
* library to spawn multiple worker threads to handle the processing of
57+
* the current batch.
5858
*
5959
* The batch system will process as many batch sets as possible until
60-
* the entire batch has been completed or half of the available memory
61-
* has been used.
60+
* the entire batch has been completed.
6261
*
6362
* This function is a drop in replacement for the existing batch_process()
6463
* function of Drupal.
@@ -279,14 +278,6 @@ function _drush_batch_worker() {
279278
// At this point, either $current_set contains operations that need to be
280279
// processed or all sets have been completed.
281280
$queue = _batch_queue($current_set);
282-
283-
// If we are in progressive mode, break processing after 1 second.
284-
if (drush_memory_limit() > 0 && (memory_get_usage() * 2) >= drush_memory_limit()) {
285-
Drush::logger()->notice(dt("Batch process has consumed in excess of 50% of available memory. Starting new thread"));
286-
// Record elapsed wall clock time.
287-
$current_set['elapsed'] = round((microtime(TRUE) - $current_set['start']) * 1000, 2);
288-
break;
289-
}
290281
}
291282

292283
// Reporting 100% progress will cause the whole batch to be considered

0 commit comments

Comments
 (0)