Fix dijkstra via bad alloc on 4.1.0 - #3124
Conversation
WalkthroughChangesDijkstra 4.0.2 fix
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pgtap/dijkstra/dijkstraVia/edge_cases/issue-3110.pg`:
- Line 8: Update both min_version('4.0.1') guards in the issue-3110 test to
min_version('4.0.2'), including the corresponding skip-message guard, and
correct the “erro” typo in that skip message. Preserve the existing plan and
test behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 383f2f61-ffc2-4eb7-be69-7f6767e9ad20
📒 Files selected for processing (8)
CMakeLists.txtNEWS.mddoc/src/release_notes.rstinclude/dijkstra/dijkstra.hpplocale/en/LC_MESSAGES/pgrouting_doc_strings.polocale/pot/pgrouting_doc_strings.potpgtap/dijkstra/dijkstraVia/edge_cases/issue-3110.pgtools/developer/taptest.sh
| BEGIN; | ||
| SET client_min_messages TO WARNING; | ||
|
|
||
| SELECT CASE WHEN min_version('4.0.1') THEN plan(6) ELSE plan(1) END; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== repo files of interest =="
git ls-files | rg '(^|/)(issue-3117\.pg|NEWS\.md|release_notes\.rst|CMakeLists\.txt)$|pgtap/dijkstra/dijkstraVia/edge_cases/issue-3110\.pg' || true
echo
echo "== target file excerpt =="
if [ -f pgtap/dijkstra/dijkstraVia/edge_cases/issue-3110.pg ]; then
cat -n pgtap/dijkstra/dijkstraVia/edge_cases/issue-3110.pg
fi
echo
echo "== search for issue-3110 and version mentions =="
rg -n "3110|bad alloc|min_version\\('4\\.0\\.[0-9]+" -S . | head -200Repository: pgRouting/pgrouting
Length of output: 29605
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== repo files of interest =="
git ls-files | rg '(^|/)(NEWS\.md|release_notes\.rst|CMakeLists\.txt)$|pgtap/dijkstra/dijkstraVia/edge_cases/issue-3110\.pg' || true
echo
echo "== target file excerpt =="
if [ -f pgtap/dijkstra/dijkstraVia/edge_cases/issue-3110.pg ]; then
cat -n pgtap/dijkstra/dijkstraVia/edge_cases/issue-3110.pg
fi
echo
echo "== search for issue-3110 and version mentions =="
rg -n "3110|bad alloc|min_version\\('4\\.0\\.[0-9]+" -S . | head -200Repository: pgRouting/pgrouting
Length of output: 28836
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== NEWS.md issue-3110 and release header context =="
nl -ba NEWS.md | sed -n '1,110p' | rg -n -C 12 'issue|3110|4\.0\.2|4\.0\.1' || true
echo
echo "== doc/src/release_notes.rst issue-3110 and release header context =="
nl -ba doc/src/release_notes.rst | sed -n '1,120p' | rg -n -C 12 '3110|4\.0\.2|4\.0\.1' || true
echo
echo "== CMakeLists.txt OLD_SIGNATURES version context =="
nl -ba CMakeLists.txt | sed -n '40,70p'Repository: pgRouting/pgrouting
Length of output: 446
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== NEWS.md issue-3110 and release header context =="
python3 - <<'PY'
from pathlib import Path
p = Path("NEWS.md")
lines = p.read_text().splitlines()
for i, line in enumerate(lines, 1):
if "3110" in line or "4.0.2 Release" in line or "4.0.1 Release" in line:
start = max(1, i-8)
end = min(len(lines), i+8)
print(f"--- context around line {i} ---")
for n in range(start, end+1):
print(f"{n:4}: {lines[n-1]}")
PY
echo
echo "== doc/src/release_notes.rst issue-3110 and release header context =="
python3 - <<'PY'
from pathlib import Path
p = Path("doc/src/release_notes.rst")
lines = p.read_text().splitlines()
for i, line in enumerate(lines, 1):
if "3110" in line or "4.0.2 Release" in line or "4.0.1 Release" in line:
start = max(1, i-8)
end = min(len(lines), i+8)
print(f"--- context around line {i} ---")
for n in range(start, end+1):
print(f"{n:4}: {lines[n-1]}")
PY
echo
echo "== CMakeLists.txt OLD_SIGNATURES version context =="
python3 - <<'PY'
from pathlib import Path
p = Path("CMakeLists.txt")
lines = p.read_text().splitlines()
start, end = 40, 70
print(f"--- lines {start}-{end} ---")
for n in range(start, end+1):
print(f"{n:4}: {lines[n-1]}")
PYRepository: pgRouting/pgrouting
Length of output: 5420
Use the release version that actually contains the fix.
issue #3110`` is recorded under the 4.0.2 release notes in `NEWS.md` and `doc/src/release_notes.rst`, with `4.0.2` also listed as a distinct `OLD_SIGNATURES` entry. Update the guards in both `min_version('4.0.1')` occurrences and the skip message to `min_version('4.0.2')`, and fix the “erro” typo.
Also applies to lines 15-17.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pgtap/dijkstra/dijkstraVia/edge_cases/issue-3110.pg` at line 8, Update both
min_version('4.0.1') guards in the issue-3110 test to min_version('4.0.2'),
including the corresponding skip-message guard, and correct the “erro” typo in
that skip message. Preserve the existing plan and test behavior.
Changes proposed in this pull request:
@pgRouting/admins
Summary by CodeRabbit
Bug Fixes
pgr_dijkstraViacould throwstd::bad_allocwhen a specified via node does not exist.Documentation
pgr_dijkstraViafix.