Opened 6 years ago

Closed 17 months ago

#13092 closed Bug Report - Crash (Trac EOL)

Python BEConnection:backendCommand timeout too low and improper protocol implementation

Reported by: angela.schmid@… Owned by: Raymond Wagner
Priority: minor Milestone: needs_triage
Component: Bindings - Python Version: 0.28.1
Severity: medium Keywords: python backendcommand timeout
Cc: Ticket locked: no


I use lossless_cut to export recordings to the video library which half of the time crashed:

CRITICAL - Export to MythVideo?, aborting script.

Error: invalid literal for int() with base 10:

The problem occurs only when the video disk had to spin up.

The root cause is a too low timeout of 10 seconds in the Python BEConnection class when calling QUERY_FILE_EXISTS.

I could identify the following problems:

which calls Video:open()
which calls ftopen(), can not provide a timeout, because the logic to use a backend is in the next method
which calls, path = FileOps(host, db=db).fileExists(filename, sgroup)
which calls backendCommand(), fileExists calls backendCommand and should provide a higher timeout.
which calls BEConnection:backendCommand(), with default timeout=10seconds
  • A user application can not provide a higher timeout.
  • fileExists calls backendCommand and should provide a higher timeout.
  • BEConnection:backendCommand() should use a higher default timeout.

The exception is misleading and caused by *not* throwing a proper exception, when hit by a timeout:

    if len(select([self.socket],[],[], timeout)[0]) == 0:
       # no data, return
       return u''

Change History (1)

comment:1 Changed 17 months ago by Stuart Auchterlonie

Resolution: Trac EOL
Status: newclosed

We have moved all bug tracking to github [1]

If you continue to have this issue, please open a new issue at github, referencing this ticket.

[1] -

Note: See TracTickets for help on using tickets.