Bug 480956

Summary: RFE: patch to limit PA logging rate to prevent it from eating my HDD again
Product: [Fedora] Fedora Reporter: Muayyad Alsadi <alsadi>
Component: pulseaudioAssignee: Lennart Poettering <lpoetter>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: lkundrak, lpoetter, pierre-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-23 23:12:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch to limit logs -p1 none

Description Muayyad Alsadi 2009-01-21 15:08:00 UTC
Created attachment 329612 [details]
patch to limit logs -p1

Description of problem:
hi,
as I reported here
https://www.redhat.com/archives/fedora-devel-list/2009-January/msg01167.html
pulseaudio eat 0.7GB from my disk space

the reason was an upstream patch called
Patch20: 0020-warn-if-ALSA-wakes-us-up-and-there-is-actually-nothi.patch

I made a patch the limit logging that specific message to 5 consecutive logs and then disable that message for an hour

Version-Release number of selected component (if applicable):
pulseaudio-0.9.13-6.fc10.i386


Additional info:
this patch uses two global variables
please tell me if this is safe

Comment 1 Muayyad Alsadi 2009-01-22 14:37:01 UTC
I have tests my patch for two days and it works

...
Jan 22 13:56:30 localhost pulseaudio[3013]: module-alsa-sink.c: ALSA woke us up 
to write new data to the device, but there was actually nothing to write! Most l
ikely this is an ALSA driver bug. Please report this issue to the PulseAudio dev
elopers.
Jan 22 13:56:30 localhost pulseaudio[3013]: module-alsa-sink.c: ALSA woke us up 
to write new data to the device, but there was actually nothing to write! Most l
ikely this is an ALSA driver bug. Please report this issue to the PulseAudio dev
elopers.
Jan 22 13:56:30 localhost pulseaudio[3013]: module-alsa-sink.c: the next message
 will be prevented from being logged again for awhile
Jan 22 13:56:30 localhost pulseaudio[3013]: module-alsa-sink.c: ALSA woke us up 
to write new data to the device, but there was actually nothing to write! Most l
ikely this is an ALSA driver bug. Please report this issue to the PulseAudio dev
elopers.

notice the above line
Jan 22 13:56:30 localhost pulseaudio[3013]: module-alsa-sink.c: the next message
 will be prevented from being logged again for awhile

it allowed consecutive logs which can be noticed from time (tells the alsa developers about the problem) and it won't flood my logs

ls -lh /var/log/messages 
-rw-r--r-- 1 root root 214K 2009-01-22 15:56 /var/log/messages

Comment 2 Lennart Poettering 2009-01-23 23:12:56 UTC
A slightly better patch (thread-safe and stuff) has now been merged upstream.