Mailing List Archive

Issue 1362 in cherokee: Stream handler needs mutex locking.
Status: New
Owner: ----

New issue 1362 by mehmetal...@gmail.com: Stream handler needs mutex locking.
http://code.google.com/p/cherokee/issues/detail?id=1362

What steps will reproduce the problem?
1. Comment out stream handler built-in cache
2. Get same file repeatedly
3. Memory usage will rise up to 100mb

What version of the product are you using? On what operating system?
Cherokee 1.2.101

Please provide any additional information below.
av_find_stream_info needs mutex locking so i found an example for it but it
is directly using pthread library's function. Cherokee has built-in
mutex-locking functions but i can't understand how to add it...

i attached sample code with some comments.

Attachments:
handler_streaming.c.diff 1.3 KB

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev@lists.octality.com
http://lists.octality.com/listinfo/cherokee-dev
Re: Issue 1362 in cherokee: Stream handler needs mutex locking. [ In reply to ]
Comment #1 on issue 1362 by mehmetal...@gmail.com: Stream handler needs
mutex locking.
http://code.google.com/p/cherokee/issues/detail?id=1362

We should not free hdl->start :) i notice it is different thing.

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev@lists.octality.com
http://lists.octality.com/listinfo/cherokee-dev
Re: Issue 1362 in cherokee: Stream handler needs mutex locking. [ In reply to ]
Updates:
Status: Started
Owner: ste...@konink.de
Labels: Type-Defect Priority-Medium Component-Logic Usability
Milestone-Stable

Comment #2 on issue 1362 by ste...@konink.de: Stream handler needs mutex
locking.
http://code.google.com/p/cherokee/issues/detail?id=1362

We should indeed do this using the native cherokee code for it, I'll
comment :)

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev@lists.octality.com
http://lists.octality.com/listinfo/cherokee-dev
Re: Issue 1362 in cherokee: Stream handler needs mutex locking. [ In reply to ]
Comment #3 on issue 1362 by 246...@gmail.com: Stream handler needs mutex
locking.
http://code.google.com/p/cherokee/issues/detail?id=1362

Add a patch that includes a "cherokized" lock manager ...

Note that the "hdl->avformat = NULL;" chunk of the original patch is not
included in this diff and should be included as a separate diff.

Attachments:
add-locks-to-handler-streaming.diff 1.1 KB

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev@lists.octality.com
http://lists.octality.com/listinfo/cherokee-dev
Re: Issue 1362 in cherokee: Stream handler needs mutex locking. [ In reply to ]
Comment #4 on issue 1362 by mehmetal...@gmail.com: Stream handler needs
mutex locking.
http://code.google.com/p/cherokee/issues/detail?id=1362

so, av_find_stream_info is never fail when getting file info.

but memory usage is raising. normally, AVFormatContext is keeping in hdl
struct so i move it into function.

i comment out some part of function and i add a variable to struct. it is
in attachment.

for now i tested this code on production server and memory usage is not
raising same as old one's.

Attachments:
func.c 2.1 KB

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev@lists.octality.com
http://lists.octality.com/listinfo/cherokee-dev
Re: Issue 1362 in cherokee: Stream handler needs mutex locking. [ In reply to ]
Comment #5 on issue 1362 by mehmetal...@gmail.com: Stream handler needs
mutex locking.
http://code.google.com/p/cherokee/issues/detail?id=1362

with comment #4's functions memory usage is still raising. so it isn't
solution.

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev@lists.octality.com
http://lists.octality.com/listinfo/cherokee-dev
Re: Issue 1362 in cherokee: Stream handler needs mutex locking. [ In reply to ]
Updates:
Status: Fixed

Comment #6 on issue 1362 by ste...@konink.de: Stream handler needs mutex
locking.
http://code.google.com/p/cherokee/issues/detail?id=1362

Mutex has been implemented thanks to 246tnt, lets track the leaking
somewhere else.

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev@lists.octality.com
http://lists.octality.com/listinfo/cherokee-dev