On Mon, Apr 25, 2016 at 12:27:56PM +0100, 'Brian Foley' via ganeti-devel wrote: > When job files are updated repeatedly by a job executor logging messages > one at a time, luxi's inotify watcher reloads the job and updates the > qRunning list in qstate. Unfortunately this is done lazily, leading to > partly parsed copies of all the job files since the job started executing > accumulating in memory. This space leak continues until the job finishes > running. > > This causes problems for cluster verify on clusters with errors which > can produce lots of messages each of which updates the job file. This case > was partly addressed with commit d929e5b566bc that logs some errors in > batches. However, even the simplest job will update the job file more than > once, so the leak always has some impact. > > Sprinkle enough strictness to force the full JSON parse to occur when the > queue is updated. > > For a (sightly contrived) test that sends 150 log messages, this reduces > the peak (profiling) heap usage of loadJobFromDisk from 900MB to 26MB, > and readJsonWithDesc from 81MB to 13MB, and makes the heap profile > approximately flat rather than growing linearly until the job finishes. > > Signed-off-by: Brian Foley <[email protected]> > --- > src/Ganeti/JQScheduler.hs | 16 +++++++++++++--- > src/Ganeti/JQScheduler/Types.hs | 9 +++++---- > 2 files changed, 18 insertions(+), 7 deletions(-)
Thanks for finding the unnecessarily unevaluated parts! In gerneral LGTM, however please reformat the patch according to the Ganeti style guide (in this case: spaces aroud braces and equality signs in records) before pushing; see http://docs.ganeti.org/ganeti/master/html/dev-codestyle.html#data-declarations Thanks, Klaus
