Project

General

Profile

Actions

Bug #11718

closed
VC VG

XMLRPC Client does not honor its default timeout value

Bug #11718: XMLRPC Client does not honor its default timeout value

Added by Vincent Caron over 5 years ago. Updated about 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Viktor Gurov
Category:
XMLRPC
Target version:
Start date:
03/22/2021
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
21.05
Release Notes:
Default
Affected Version:
2.5.0
Affected Architecture:
All

Description

I have traced an XMLRPC problem where I got a systematic mysterious error when starting a sync between my firewalls (on a dedicated crossover link) :

"A communications error occurred while attempting to call XMLRPC method host_firmware_version: @ 2021-03-19 16:30:45"

First, it turns out that the XMLRPC exception is not properly printed out which did not help to diagnose the problem. I made this simple change in xmlrpc_client.php :

- $this->error = "A communications error occurred while attempting to call XMLRPC method {$method}: " . $errormsg[1];
+ $this->error = "A communications error occurred while attempting to call XMLRPC method {$method}: " . $e->getMessage();

With this patch things started to get more helpful, the error message turned into :

"A communications error occurred while attempting to call XMLRPC method restore_config_section: Request timed out due to default_socket_timeout php.ini setting"

It turns out that php.ini has no 'default_socket_timeout', and the internal default is 60s. As a quick test I added default_socket_timeout=240 in '/etc/rc.php_ini_setup' then restarted PHP-FPM. My sync finally worked, because it turned out that it took 107s to sync (I have 253 interfaces, maybe that's related).

I think that the XMLRPC client should at least call ini_set('default_socket_timeout', $timeout) before invoking a remote method in order for it to honour its default 240s $timeout.

JP Updated by Jim Pingle over 5 years ago Actions #2

  • Status changed from New to Pull Request Review
  • Target version set to CE-Next

JP Updated by Jim Pingle over 5 years ago Actions #3

  • Subject changed from xmlrpc_client.php cannot honor its 240s default timeout because default_socket_timeout is not defined and defaults to 60s (with patch) to XMLRPC Client does not honor its default timeout value

Simplifying subject for release notes.

JP Updated by Jim Pingle over 5 years ago Actions #4

  • Plus Target Version set to 21.05

Updated by Anonymous over 5 years ago Actions #5

  • Status changed from Pull Request Review to Feedback

VG Updated by Viktor Gurov over 5 years ago Actions #6

  • % Done changed from 0 to 100

Applied in changeset commit:4f26f187d8cc5028646e86fbb95ce91552d062c2.

JP Updated by Jim Pingle over 5 years ago Actions #7

  • Target version changed from CE-Next to 2.5.2

MM Updated by Marcos M over 5 years ago Actions #8

  • Status changed from Feedback to Resolved

This fix has resolved a couple of different setups where the 60s timeout was being hit. Afterwards, the xmlrpc calls completed successfully.

Marking as resolved.

RB Updated by Renato Botelho about 5 years ago Actions #9

  • Assignee set to Viktor Gurov
Actions

Also available in: Atom