Skip to content

feat(go/adbc): align default trace path with ADBC config layout#4527

Merged
lidavidm merged 2 commits into
apache:mainfrom
Mandukhai-Alimaa:feat/align-trace-file-paths
Jul 20, 2026
Merged

feat(go/adbc): align default trace path with ADBC config layout#4527
lidavidm merged 2 commits into
apache:mainfrom
Mandukhai-Alimaa:feat/align-trace-file-paths

Conversation

@Mandukhai-Alimaa

Copy link
Copy Markdown
Contributor

Update the Go driverbase adbcfile trace writer to use the ADBC config-directory layout
Use temp directories for the existing rotating-file tests

Closes #4501

@lidavidm lidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

CC @binarycat-dremio

Comment thread docs/source/driver/flight_sql.rst Outdated
Comment on lines +230 to +232
- Windows: ``%APPDATA%\ADBC\Traces``
- macOS: ``~/Library/Application Support/ADBC/Traces``
- Linux: ``$XDG_CONFIG_HOME/adbc/traces`` or ``~/.config/adbc/traces``

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if these dirs are the right call here. Since traces are more like log files than config files, shouldn't traces go in the equivalent of $XDG_DATA_HOME? I'm still a +1 on this PR but I wonder if there's any benefit to storing traces in a non-roaming location.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that's a fair point.

Following https://pypi.org/project/appdirs/ maybe it should be:

  • ~/Library/Logs/ADBC
  • ~/.cache/adbc/traces
  • %LOCALAPPDATA%\ADBC\Traces

?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, platformdirs uses ~/.local/state for Linux.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That corresponds to $XDG_STATE_HOME

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, yeah maybe XDG_DATA_HOME isn't right either. Maybe we can find some examples, I'll look.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to find anything examples that help and this makes sense now that I think about it: Software that produces logs and traces is usually installed at the system level so XDG base dir stuff doesn't come up. i.e., traces would just go in /var/log/$app.

$XDG_STATE_HOME seems like a good fit:

The $XDG_STATE_HOME contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in $XDG_DATA_HOME

So I'd go with:

  • macOS: ~/Library/Application Support/ADBC/Traces
  • Linux: $XDG_STATE_HOME/adbc/traces or $HOME/.local/state/adbc/traces if $XDG_STATE_HOME is not set
  • Windows: %LOCALAPPDATA%\ADBC\Traces

My reasoning for my choice for macOS above is two-fold: (1) platform dirs uses that dir for user_state_dir (2) it's just simpler to use a single dir for everything on a platform without a clearly-defined pattern for XDG base dirs.

@lidavidm
lidavidm merged commit 60e010c into apache:main Jul 20, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align driver-managed trace file paths with existing ADBC config directory conventions

4 participants