Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 18 months ago

Closed 15 months ago

Last modified 15 months 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@… 18 months ago.
0001-Added-SafeConnectToMasterServer-to-CoreContext-to-pr.patch (6.1 KB) - added by peper03@… 17 months ago.
Added-SafeConnectToMasterServer.diff (2.1 KB) - added by peper03@… 17 months ago.
2nd, alternative bugfix
Added-SafeConnectToMasterServer2.diff (2.2 KB) - added by peper03@… 15 months ago.
Fixed patch to actually return a value and use it correctly!

Download all attachments as: .zip

Change History (8)

Changed 18 months ago by peper03@…

Changed 17 months ago by peper03@…

comment:1 Changed 17 months ago by peper03@…

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

Changed 17 months ago by peper03@…

2nd, alternative bugfix

comment:2 Changed 17 months 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 15 months ago by peper03@…

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

comment:3 Changed 15 months ago by Richard <peper03@…>

  • Owner set to Richard <peper03@…>
  • Resolution set to fixed
  • Status changed from new to closed

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 15 months ago by wagnerrp

  • Milestone changed from unknown to 0.27

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.