Skip to main content

TimeshiftWindowClient is not released on failing to start buffering.

2 replies [Last post]
BigiCP
Offline
Joined: 2011-03-28
Points: 0

In BufferingRequestImpl.startBuffering(), it gets a TimeShiftWindowClient by calling the method TimeShiftManager.getTSWByDuration(). During the execution of this method a new tswc is created and added to the tsw. Also NI resource usages are updated properly. If the tswc is in the state TSWSTATE_READY_TO_BUFFER/TSWSTATE_BUFFERING it calls tswc.attachFor(). This method can throw IllelgalStateException/IllegalArgumentException. These exceptions are not handled properly. attachFor() itself catches these excepitons, updates the constraints and throws it again. But tswc is not released anywhere.

These are the points which needs clarification:
1) From BufferingRequestImpl.startBuffering() when attachFor(TimeShiftManager.TSWUSE_BUFFERING) is called, on getting IllegalstateException/IllegalArgumentException, the tswc is not released. In the same file, in WFTunedState.tswChanged(), on getting IllegalStateException it is releasing tswc and changing the state to m_retryStateImpl.
2) In BufferingRequestImpl.startBuffering(), IllegalStateException is caught and does not do any action. IllegalArgumentException is not caught and hence it is propagated to applicaiton.
3) In WFTunedState.tswChanged(), it is catching IllegalStateException and handles properly. But it does not handle IllegalArgumentException.

Also, TimeShiftWindowClient.attachFor() is called from multiple places and at all the places other than from BufferingRequestImpl, exceptions are caught and not done any action.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cpratt
Offline
Joined: 2008-12-18
Points: 0

Yeah, this error handling needs to be cleaned up.

Could you file a bug for this?

BigiCP
Offline
Joined: 2011-03-28
Points: 0