Skip to content

pino instrumentation might modify user object #2024

@dygabo

Description

@dygabo

What did you do?

reviewed code of pino instrumentation

What did you expect to see?

Expected the instrumentation to have no visible side effects on the objects passed as parameters

What did you see instead?

There might be visible changes to the passed options object that if called with an additional constructor might result in multiple wrappers of the mixin function, in extreme situations very deep call stacks and possible crashes

If we consider following example:
const options = {};
const firstLogger = pino(options); // this will alter the options object => options.mixin = see here
const secondLogger = pino(options); // this will again alter it but at a different location => options.mixin = see here
const thirdLogger = pino(options); // this will again alter the object at the previous location

thirdLogger.error("some Error"); // this will have mixin => mixin => mixin on the call stack before it's done

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpkg:instrumentation-pinopriority:p3Bugs which cause problems in user apps not related to correctness (performance, memory use, etc)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions