Wowza Community

Close references to file so it can be moved

My VOD interface allows the user to move a file to another directory. In order to do this, it signals Wowza to close all references to the stream so the underlying file can be moved. This works correctly on my Windows 7 development machine, but does not work on the Server 2008 production machine. On the Server 2008 install, the player gets notified of the error correctly, but Wowza keeps a handle open to the file, preventing the file move from working. Both installs are 4.1.0 with identical configuration except for the StorageDirs.

Do I need to do something else to get Wowza to relinquish its file handle?

Relevant module code:

	public void endWithError(IMediaStream stream, String code, String desc) {
		sendStreamOnStatusError(stream, code, desc);
		Timer t = new Timer();
		t.schedule(new StreamKiller(stream), 500);
	}
	
	class StreamKiller extends TimerTask {
		private final IMediaStream stream;
		StreamKiller (IMediaStream stream) {
			this.stream = stream;
		}
		public void run() {
			stream.getClient().rejectConnection();
			stream.getClient().shutdownClient();
		}
	}
// the matched streams are terminated like so:
streamModule.endWithError(stream, "NetStream.Play.StreamNotFound", "Video was moved or renamed");

Hello there,

Are you seeing any indication of the issue in the logs? You could compare the logs from the development machine with the logs from the production machine and maybe narrow done the problem.

Troubleshooting custom code is a bit out of scope for the forum, although it does happen on occasion. You might consider posting to the find a consultant forum.

Kind regards,

Salvadore

Hi,

This will now be handled via the ticket you have created (106291).

Thanks,

Jason

Hello Jeremy,

I can see that your ticket has been active and a member of our support team has responded to it, please see below which is the response in the ticket.

Thank you for contacting Wowza support. I’d suggest ensuring all connections are no longer present on the stream/asset itself. You can iterate through each connection and close any still remaining that may prevent the asset from being accessed externally thereafter. If the player attempts to reconnect, however, it will then still prolong that period of time.

In the logs you’ve provided I see the following:

014-10-15 16:33:26 EDT stop stream INFO 200 2014/Group 2014-10-10c.mp4 - - - - 11.572 - - - - - - - - - - 1 9067 0 6763910 2014/Group 2014-10-10c.mp4 49dd92a21f64e92a2f899a4d05f49cb57cb90b11 D:\content\2014\Group 2014-10-10c.mp4 mp4 18153538 24.373 rtmpt://localhost:1935/vod/2014/Group 2014-10-10c.mp4?49dd92a21f64e92a2f899a4d05f49cb57cb90b11 rtmpt://localhost:1935/vod/2014/Group 2014-10-10c.mp4 49dd92a21f64e92a2f899a4d05f49cb57cb90b11 - -

2014-10-15 16:33:26 EDT destroy stream INFO 200 2014/Group 2014-10-10c.mp4 - - - - 11.574 - - - - - - - - - - 1 - 0 6763910 2014/Group 2014-10-10c.mp4 49dd92a21f64e92a2f899a4d05f49cb57cb90b11 - - - - rtmpt://localhost:1935/vod/2014/Group 2014-10-10c.mp4?49dd92a21f64e92a2f899a4d05f49cb57cb90b11 rtmpt://localhost:1935/vod/2014/Group 2014-10-10c.mp4 49dd92a21f64e92a2f899a4d05f49cb57cb90b11 - -

2014-10-15 16:33:26 EDT disconnect session INFO 200 1443937469

Which shows the stop from the player (and it was the only connection) then the stream being destroyed.

If you can restart your Wowza server and do a simple test that would demonstrate the issue you’ve suggested in the forums then zip up your latest conf/ and logs/ for further review.

Jason

Hi,

I see you have a new ticket open (108379) and it appears that you’re receiving our responses this time.

Please refer to this ticket for further updates regarding this issue.

Thanks

Jason

For Flash clients try with IClient.setShutdownClient(true);

For example:

stream.getClient().setShutdownClient(true);

For HTTP take a look at this example:

How to control access to an HTTP stream (cupertinostreaming, smoothstreaming, sanjosestreaming, mpegdashstreaming)

httpSession.rejectSession();

Salvadore

I think the best bet here would be to open a ticket.

Please zip up your /conf and /logs folders and send them to support@wowza.com. In the email please also include a link to this thread as a reference.

Thank you,

Salvadore

Hello, the Wowza support team usually responds within a few days. It is possible the email reply has landed in your spam folder.

Salvadore

Working (Windows 7):

INFO stream play sample.mp4 -

INFO server comment - APIServer: terminating matched VOD stream: /sample.mp4 from 127.0.0.1

INFO stream stop sample.mp4 -

INFO stream destroy sample.mp4 -

INFO session disconnect 305586820 -

Not working (Server 2008):

INFO stream play sample.mp4 -

INFO server comment - APIServer: terminating matched VOD stream: /sample.mp4 from 127.0.0.1

In other words, the stream never gets destroyed. So what’s the correct way to force a stream closed?

Same result with setShutdownClient(true). It looks like the stream gets closed by the “watchdog” after about 90 seconds, but this is much too slow for my purposes. Note the timestamps:

2014-10-15 12:20:51 INFO server comment - APIServer: terminating matched VOD stream: /2014/Group 2014-10-10.mp4 from 127.0.0.1
2014-10-15 12:20:52 INFO server comment - StreamModule: running setShutdownClient(true) for 2014/Group 2014-10-10.mp4
2014-10-15 12:22:21 INFO session comment 624980120 client connectionClosed [624980120] watchdog
2014-10-15 12:22:21 INFO stream stop 2014/Group 2014-10-10.mp4 -
2014-10-15 12:22:21 INFO stream destroy 2014/Group 2014-10-10.mp4 -
2014-10-15 12:22:21 INFO session disconnect 624980120 -

When can I expect to see an update on this support case? I have e-mailed support@wowza.com with no response.

Bump. I would like to see an update on ticket 106291 either here or by e-mail.

I have no responses from Wowza, in my spam folder or otherwise. Sent another e-mail just now. I’m trying very hard to keep my commentary to myself at the moment.

I have not received that message via e-mail. Where can I see my ticket status?

The log and conf files I sent via e-mail (and which are quoted above) demonstrate the issue exactly: player stop, stream destroyed, but the file handle is still in use so I can’t rename the file.