Skip to content

jdk profiling & create-prs scripts - #29

Open
msladek wants to merge 1 commit into
devfrom
profiling
Open

jdk profiling & create-prs scripts#29
msladek wants to merge 1 commit into
devfrom
profiling

Conversation

@msladek

@msladek msladek commented Jul 31, 2026

Copy link
Copy Markdown
Member

No description provided.

Comment thread jdk/profile-jfr.sh
recording=false

stop_rec() { [ "$recording" = true ] && "${cmd[@]}" jcmd 1 JFR.stop name="$profile"; }
trap stop_rec EXIT

@fpichler fpichler Aug 4, 2026

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.

[P1] Make this cleanup signal-safe and success-safe.

Interrupting the read with Ctrl-C terminates the script without running this EXIT trap, leaving the JFR recording active. A failed copy also leaves the remote /tmp artifact. On the normal success path, recording=false makes stop_rec return status 1, so the EXIT trap turns an otherwise successful run into a failure.

Smallest fix: use one idempotent cleanup function that stops an active recording, always removes the remote file, and returns 0; install it for EXIT, INT, TERM, and HUP.

Comment thread jdk/dump-heap.sh
"${cmd[@]}" jcmd 1 VM.flags
"${cmd[@]}" jcmd 1 GC.heap_info
"${cmd[@]}" jcmd 1 GC.heap_dump "$tmpfile"
"${cmd[@]}" cat "$tmpfile" > "$dump"

@fpichler fpichler Aug 4, 2026

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.

[P1] Create diagnostic artifacts with private permissions.

With the normal 022 umask, this redirection creates a mode-0644 heap dump. Heap dumps can contain credentials and live application data; profile-jfr.sh:21 has the same issue for JFR data and recorded environment/system properties.

Smallest fix: set umask 077 before creating either output and ensure an existing destination is forced to mode 0600.

Comment thread git/create-prs.sh
--json nameWithOwner --jq '.[].nameWithOwner')

for repo in $repos; do
gh api "repos/$repo/branches/$branch" --silent >/dev/null 2>&1 || continue

@fpichler fpichler Aug 4, 2026

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.

[P1] Do not treat every API failure as “branch absent”.

Authentication failures, rate limits, API outages, and network errors all take this || continue path with stderr discarded. If every lookup fails, the batch prints nothing and exits successfully without creating any PRs.

Smallest fix: continue only for an explicit 404; surface other failures and return a non-zero status or a failure summary.

Comment thread mvn/README.md
```bash
<toolbox>/mvn/build-dependency-tree.py ~/workspace > dependency.tree
```

@fpichler fpichler Aug 4, 2026

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.

[P1] Restore these workflows or provide their replacements in a dedicated retirement change.

This PR removes the documented prepare-release and major-upgrade workflows and deletes their scripts, along with the repository-bootstrap and deployment helpers, without migration guidance. The root README still advertises repository cloning, deployment helpers, and Maven release workflows, so users updating to this branch receive missing-command and stale-documentation failures unrelated to the profiling feature.

Smallest fix: restore these removals in this PR. If retirement is intentional, split it out and update the surviving contract with concrete replacement commands.

Comment thread git/create-prs.sh

for repo in $repos; do
gh api "repos/$repo/branches/$branch" --silent >/dev/null 2>&1 || continue
pr=$(gh pr list --repo "$repo" --head "$branch" --state open \

@fpichler fpichler Aug 4, 2026

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.

[P2] Include the requested base branch in existing-PR detection.

The script forwards arbitrary gh pr create options, including --base, but this lookup filters only by head. If the same head already has an open PR to a different base, a request such as --base release is incorrectly skipped.

Smallest fix: determine the effective base and include it in gh pr list, or explicitly reject --base instead of advertising arbitrary create options.

@fpichler fpichler assigned msladek and unassigned fpichler Aug 4, 2026
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.

2 participants