Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11238 closed Patch - Bug Fix (fixed)

Master backend can shutdown in spite of active local frontend

Reported by: peper03@… Owned by: Richard <peper03@…>
Priority: minor Milestone: 0.27
Component: MythTV - General Version: 0.26-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

On a combined BE/FE system, the frontend does not always register with the backend, which can lead to the backend shutting down due to the idle timer.

The BackendConnectionManager? usually ensures a connection to the backend by querying the 'Master host prefix'. On a combined BE/FE this prefix can be retrieved directly without having to communicate with the backend and no connection is made.

If the user starts the frontend but performs operations (e.g. listening to NetRadio?) that do not need to query the backend, no connection will ever be made and the backend will continue to count down the idle timer.

If the user stays in the main menu for at least 15 seconds after starting the frontend, the ThemeUpdateChecker? will cause a connection to the backend to be made but if he or she is not in the main menu when the 15 second timer expires, the check is not made.

The attached patch ensures that querying the master host prefix will always result in a connection to the backend.

Whether this is the cleanest solution is debatable as querying the master host prefix does not need to imply that a connection will be made to the master BE, but that is the behaviour already assumed by the BackendConnectionManager?.

This problem may be the cause of #10971

Attachments (4)

0001-Calling-GetMasterHostPrefix-now-always-causes-a-conn.patch (1.5 KB) - added by peper03@… 11 years ago.
0001-Added-SafeConnectToMasterServer-to-CoreContext-to-pr.patch (6.1 KB) - added by peper03@… 11 years ago.
Added-SafeConnectToMasterServer.diff (2.1 KB) - added by peper03@… 11 years ago.
2nd, alternative bugfix
Added-SafeConnectToMasterServer2.diff (2.2 KB) - added by peper03@… 11 years ago.
Fixed patch to actually return a value and use it correctly!

Download all attachments as: .zip

Change History (8)

Changed 11 years ago by peper03@…

Changed 11 years ago by peper03@…

comment:1 Changed 11 years ago by peper03@…

Sorry, ignore that last patch. Git screw-up!

Changed 11 years ago by peper03@…

2nd, alternative bugfix

comment:2 Changed 11 years ago by peper03@…

The last patch 'Added-SafeConnectToMasterServer?.diff' is an alternative bugfix that adds a thread-safe alternative to ConnectToMasterServer? and avoids BackendConnectionManager? from exploiting a side-effect of GetMasterHostPrefix?.

Changed 11 years ago by peper03@…

Fixed patch to actually return a value and use it correctly!

comment:3 Changed 11 years ago by Richard <peper03@…>

Owner: set to Richard <peper03@…>
Resolution: fixed
Status: newclosed

In a9246e95cffb116d29098787a9bf8ddca1fe1945/mythtv:

Fix frontend not connecting to the master backend on startup

On a combined BE/FE system, the frontend does not always register with
the backend, which can lead to the backend shutting down due to the idle timer.

The BackendConnectionManager?? usually ensures a connection to the
backend by querying the 'Master host prefix'. On a combined BE/FE
this prefix can be retrieved directly without having to communicate
with the backend and no connection is made.

The fix adds a thread-safe alternative to ConnectToMasterServer?() and
avoids BackendConnectionManager?() from exploiting a side-effect of
GetMasterHostPrefix?()

Fixes #11238

Signed-off-by: Stuart Morgan <smorgan@…>

comment:4 Changed 11 years ago by Raymond Wagner

Milestone: unknown0.27
Note: See TracTickets for help on using tickets.