mDNS configuration

Bug #1355641 reported by Didier Moens
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Won't Fix
Undecided
Unassigned

Bug Description

version : 1.205
(enhancement request)

When running multiple calibre-server instances on the same host (or in the same network), all instances are announced as "Books in calibre".
This makes the different collections indistinguishable in e.g. Calibre Companion.

Proposed solution :

Convert the string constant "Books in calibre", located in '/calibre/library/server/base.py, class Bonjour(), def mdns_services()' to a string parameter, and provide a user configuration in Preferences > Sharing > Sharing over the net.

As an alternative to this user configuration, this string could by default include library title and/or hostname, and be configurable through Prefrences > Advanced > Tweaks.

description: updated
description: updated
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1355641

Changing the component for this bug.

 assignee cbhaley
 status triaged

Changed in calibre:
assignee: nobody → Charles Haley (cbhaley)
status: New → Triaged
Revision history for this message
Kovid Goyal (kovid) wrote :

There are various issues to consider:

1) I would prefer no extra config for this, it should just use the
library name

2) The problem with library name is what happens if the library name is
non-ascii or very long. I dont know how well mDNS clients deal with
either of these issues.

3) IIRC the bonjour service is started before the library is opened, so
there will need to be some way to dynamically change the string
advertised by the service, something I am not sure is doable.

@Charles: These issues mean that this is too much work for me, but if
you are interested, feel free to take it up.

Revision history for this message
Charles Haley (cbhaley-deactivatedaccount) wrote :

I am very nervous about touching this stuff.

Considering your issues:

2) mDNS requires 7-bit ascii, and probably a limited set of characters as well. It wouldn't surprise me if there are length limits.

3) AFAIK: the only way to change mDNS parameters is to shut off and restart the service, which is not atomic.

Add to these the problem of unintended consequences. Are there clients out there that will break if the host string changes and especially if it changes length? I would not be at all surprised if the answer is "yes".

Since the OP mentioned CC, I assume that is where the problem is being encountered. CC already shows the host name when it detects multiple servers so this is a problem only when using multiple calibre-server instances on the same machine. These instances must use different ports, so the port number can be used to distinguish them. I will change CC to show the port number in the choose server dialog. Also, in case it matters to the OP, I will change CC to merge the servers found via WD broadcast and mDNS.

Marking "wontfix" because from calibre's point of view, nothing will change.

Changed in calibre:
status: Triaged → Won't Fix
Revision history for this message
Didier Moens (didier-moens) wrote :

(thanks for the very quick & efficient bug-handling ; donated)

I concur with the issue of possible problems with clients expecting the current string ; port number is hence a valid differentiator for CC.

Nevertheless, wouldn't it be a feasible (and elegant) construction to define a host string change through an optional parameter in the "calibre-server" CLI app, considering the fact that people using 'calibre-server' are quite aware of what they're dealing with ?

Currently and as a (hopefully temporary) workaround, for each running instance I copy the code tree and hexedit the string in base.pyo . This works fine, but is both cumbersome and inefficient.

(sidenote : in its server connection list, CC detects/shows 2 identical entries for each instance ; does this warrant a bug report ?)

Revision history for this message
Kovid Goyal (kovid) wrote :

As Charles, said, he will change CC to display port numbers, I dont want
to add an option to change the string advertised via mDNS because it
adds another point of failure to something that is already fairly hard
to diagnose, for a relatively uncommon use case. Having an option means
that everytim time some says that mDNS is not working for them, we have
to check if they used that option to overwrite the string.

Revision history for this message
Charles Haley (cbhaley-deactivatedaccount) wrote :

Re: (sidenote : in its server connection list, CC detects/shows 2 identical entries for each instance ; does this warrant a bug report ?)

First, this isn't the right place for CC bug reports/discussions. They belong on the CC forum http://www.mobileread.com/forums/forumdisplay.php?f=264. And in any event, I don't see this. For me, CC reports one line for each mDNS response. It is true that without the port number (the case in V3.4.2) they appear identical, but they are in fact different responses. If you are really seeing multiple responses for each instance with CC V3.4.2, please open a thread on the CC forum so we can discuss it further.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.