Skip to content

Remove stdout, stderr, print buffering by default #495

Description

@eabatalov

When user code breaks their debug prints are frequently not visible in Cloud UI because the prints are buffered inside a hanging Python process memory buffer, i.e.:

@function()
def my_function() -> int:
    print("Debug print")
    # Or crash the process here instead.
    while True:
         pass

In this case the debug print is not visible in cloud UI logs because the printed string is in a Python process buffer and it's not written yet into stdout file descriptor so Log Saver can ingest the debug print and send it into our logging backends.

To fix this we need to remove all buffering in logs printed via:

  • print()
  • write(sys.stdout)
  • write(sys.stderr).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions