Ticket #24501: 0001-Make-the-log-message-more-quantitative.patch

File 0001-Make-the-log-message-more-quantitative.patch, 2.0 KB (added by ffmancera, 2 years ago)
  • new file changes/ticket24501

    From 6be9cdc43c5ae28614f728de2eaed7c04b460aad Mon Sep 17 00:00:00 2001
    From: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
    Date: Mon, 4 Dec 2017 18:51:29 +0100
    Subject: [PATCH] Make the log message more quantitative
    
    Expose buf_get_total_allocation(), tor_compress_get_total_allocation(),
    tor_compress_get_total_allocation() when hit MaxMemInQueues threshold.
    
    Fixes #24501
    
    Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
    ---
     changes/ticket24501  |  4 ++++
     src/or/circuitlist.c | 11 ++++++++---
     2 files changed, 12 insertions(+), 3 deletions(-)
     create mode 100644 changes/ticket24501
    
    diff --git a/changes/ticket24501 b/changes/ticket24501
    new file mode 100644
    index 000000000..2a475234d
    - +  
     1  o Code simplification and refactoring: 
     2    - Make the log more quantitative exposing buf_get_total_allocation(),
     3      tor_compress_get_total_allocation(), tor_compress_get_total_allocation()
     4      when we hit MaxMemInQueues threshold. Closes ticket 24501.
  • src/or/circuitlist.c

    diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
    index d37d986f1..f216c7855 100644
    a b circuits_handle_oom(size_t current_allocation) 
    23292329  int n_circuits_killed=0;
    23302330  int n_dirconns_killed=0;
    23312331  uint32_t now_ms;
    2332   log_notice(LD_GENERAL, "We're low on memory.  Killing circuits with "
    2333              "over-long queues. (This behavior is controlled by "
    2334              "MaxMemInQueues.)");
     2332
     2333  log_notice(LD_GENERAL, "We're low on memory (buffer total allocation: %zd,"
     2334             " tor compress total allocation: %zd, rendezvous cache total"
     2335             " allocation: %zd). Killing circuits with over-long queues."
     2336             " (This behavior is controlled by MaxMemInQueues.)",
     2337             buf_get_total_allocation(),
     2338             tor_compress_get_total_allocation(),
     2339             rend_cache_get_total_allocation());
    23352340
    23362341  {
    23372342    size_t mem_target = (size_t)(get_options()->MaxMemInQueues *