Opened 8 months ago

#3609 new feature-request

Add a way to query daemon RPC protocol version

Reported by: tobbez Owned by:
Priority: minor Milestone: needs verified
Component: Core Version: develop
Keywords: Cc:

Description

Currently, Deluge silently ignores all RPC messages specifying a protocol version that doesn't match the daemon's.

This means clients that support multiple protocol versions (in order to support multiple Deluge versions) must probe the server by sending a call for each protocol version it supports, and then determine the daemon's protocol version based on the single response.

In pseudo-code:

send_call('daemon.info', protocol_version=1)
send_call('daemon.info', protocol_version=2)
send_call('daemon.info', protocol_version=3)
response = recv()
# [then parse protocol version from the response]

Determining the daemon's protocol version this way causes many warning messages in the daemon log:

00:59:29 [INFO    ][deluge.core.rpcserver         :179 ] Deluge Client connection made from: 172.18.0.2:46016
00:59:29 [WARNING ][deluge.transfer               :111 ] Error occurred when parsing message header: Received invalid protocol version: 120. PROTOCOL_VERSION is 1..
00:59:29 [WARNING ][deluge.transfer               :112 ] This version of Deluge cannot communicate with the sender of this data.
00:59:29 [WARNING ][deluge.transfer               :130 ] Failed to decompress (0 bytes) and load serialized data with rencode: Error -5 while decompressing data: incomplete or truncated stream
00:59:29 [WARNING ][deluge.transfer               :111 ] Error occurred when parsing message header: Received invalid protocol version: 68. PROTOCOL_VERSION is 1..
00:59:29 [WARNING ][deluge.transfer               :112 ] This version of Deluge cannot communicate with the sender of this data.
00:59:29 [WARNING ][deluge.transfer               :130 ] Failed to decompress (0 bytes) and load serialized data with rencode: Error -5 while decompressing data: incomplete or truncated stream
00:59:29 [WARNING ][deluge.transfer               :111 ] Error occurred when parsing message header: Received invalid protocol version: 120. PROTOCOL_VERSION is 1..
00:59:29 [WARNING ][deluge.transfer               :112 ] This version of Deluge cannot communicate with the sender of this data.
00:59:29 [WARNING ][deluge.transfer               :130 ] Failed to decompress (0 bytes) and load serialized data with rencode: Error -5 while decompressing data: incomplete or truncated stream
00:59:30 [INFO    ][deluge.core.rpcserver         :205 ] Deluge client disconnected: [('SSL routines', '', 'unexpected eof while reading')]

Emitting these warnings during what (from the user's point of view) is normal operations is not desirable, but neither is removing them completely.

One idea for a solution:

  • Add a frozen RPC call for which the daemon ignores the protocol specified by the client and always responds. The wire format for call and response for this method must stay the same even when the daemon's protocol version changes.

Today, the issue described by this ticket can be avoided by dropping support for earlier versions of Deluge (2.0 betas and 1.3).

However, if the protocol version is ever increased, the problem will reoccur. For a solution to be of value, it would need to be in place before the protocol version is bumped (with a large margin, so it has had time to become widely deployed).

External references:

Change History (0)

Note: See TracTickets for help on using tickets.