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

Investigate strategies to avoid truncation in 'eventv'

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            alison.felizzi Alison Felizzi
            Reporter:
            alison.felizzi Alison Felizzi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: