Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-8452

Investigate strategies to avoid truncation in 'eventv'

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • 5

      Context

      Currently our internal event handler method ('eventv') creates a formatted message in a stack buffer. This is to ensure we can reliably produce messages, where allocating a buffer for the message could end up failing.

      In the case we overrun the stack buffer size, the resulting message gets truncated (+ we print an additional message indicating the message was truncated).

      In this ticket, we ideally want to investigate possible approaches where the message doesn't get truncated. Ideally a strategy could look like:

      1. Start with a stack buffer.
      2. If we overflow the stack buffer, switch to allocating a heap buffer to fit the message.
        1. If allocation fails, fall back to the previous buffer and accept message truncation.

      The above strategy is possibly an over simplification of the problem space, given the dynamic nature of the JSON string construction (recently added). Though hopefully this ticket will investigate a feasible strategy.

      Definition of Done

      • Investigate and spike approach.

            Assignee:
            alison.felizzi@mongodb.com Alison Felizzi (Inactive)
            Reporter:
            alison.felizzi@mongodb.com Alison Felizzi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: