In my configuration ( php 5.4 MariaDB galera cluster, 3 web servers ) I sometimes get error 500 from PHP on the ajax calls even If I receive correctly the json from the drupal backend.
This gets fixed by the patch below, inserting a drupal_exit after the drupal_json_output on _batch_do to exit correctly from the php script.
I didn't find anybody having this problem yet and I'm not quite sure about the correctness of this idea but I would love to have any feedback about this.

CommentFileSizeAuthor
#2 _batch_do_exit-2592271-1.patch357 bytesdriki_

Comments

drico created an issue. See original summary.

driki_’s picture

StatusFileSize
new357 bytes

please find the patch

driki_’s picture

I was just looking at this function from includes/xmlrpcs.inc :
function xmlrpc_server_output($xml) {
$xml = '<?xml version="1.0"?>' . "\n" . $xml;
drupal_add_http_header('Content-Length', strlen($xml));
drupal_add_http_header('Content-Type', 'text/xml');
echo $xml;
drupal_exit();
}

I think it probably would make sense to have the same behaviour on drupal_json_output maybe.

I'll try to get the full stack of hook for batch and a normal page in a following comment.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.