jackc / jackc/pgx

Tracelog truncation can make output longer.

Open
#2,095 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
14.3k
Forks
1.1k
Avg merge
6d 9h
Merged PRs (30d)
11

Description

This is a pretty small nitpick, but I noticed:

https://github.com/jackc/pgx/blob/ea9610f6722e0c6c6073660f14ded3c9683a593e/tracelog/tracelog.go#L101

The message indicating truncation can take up more space than the number of bytes being removed - i.e. if you commonly have values of 65 bytes, it will truncate 1 byte but print out an extra ` (truncated 1 bytes)`, which is 20 more bytes. Maybe changing this can be rolled into a solution for https://github.com/jackc/pgx/issues/998

Contributor guide

Open the contributing guide

Research direction

Start at tracelog/tracelog.go around line 101 and inspect how truncation length and the truncation message are calculated. Review issue #998 for the related direction, then verify that truncating values does not produce output longer than the original value.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability-sre
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.