Custom OrderProcessed event, CPU/allocation/lock workloads, a diagnostic endpoint over the JVM's live FlightRecorder state, a JUnit test using the jdk.jfr.Recording API, and nine captured recordings (flagship, mid-flight snapshot, isolated vs concurrent threshold comparisons, and a real dump+stop duplication bug) with their docs/output/*.txt transcripts.
20 lines
788 B
Bash
Executable File
20 lines
788 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Reproduces the dump/stop duplication trap documented in
|
|
# docs/output/09-dump-duplication-bug.txt. Do not copy this pattern.
|
|
#
|
|
# Usage: scripts/reproduce-dump-bug.sh <pid>
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
PID="${1:?usage: reproduce-dump-bug.sh <pid>}"
|
|
mkdir -p recordings
|
|
DEST="$(pwd)/recordings/dump-duplication-bug.jfr"
|
|
|
|
jcmd "$PID" JFR.start name=live settings=profile filename="$DEST" maxsize=256m
|
|
scripts/load.sh all
|
|
# BUG: dumping to the SAME path the recording is already configured to write to...
|
|
jcmd "$PID" JFR.dump name=live filename="$DEST"
|
|
# ...then stopping with no filename, which falls back to that same path.
|
|
jcmd "$PID" JFR.stop name=live
|
|
|
|
echo "wrote $DEST -- every event in it is duplicated. See docs/output/09-dump-duplication-bug.txt"
|