FullConnectivityChecker rejects a reachable historical tree used only as a thin-pack delta base

未关闭
#316 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
git, java
领域
backend, devtools

调研方向

Start with FullConnectivityChecker.checkObjects around lines 191–196 in org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/connectivity/FullConnectivityChecker.java and read the reproduction in repro/README.md. Run the supplied fixture to confirm the historical-base case fails while the current-tip and full-pack controls pass. Done means strict connectivity checking accepts all three valid packs, with focused tests covering the historical tree used as an omitted delta base.

由索引模型根据 Issue 内容生成。

描述

Version

7.7

Operating System

Linux/Unix

Bug description

A valid thin pack is rejected when its omitted REF_DELTA base is a tree that
exists and is reachable through an ancestor of an advertised commit. The same
incoming graph is accepted when the base is the advertised commit's own tree,
or when the new tree is sent in full.

The attached repro/ is self-contained apart from a JDK, Python 3 and public
JGit dependency jars. It creates only synthetic objects in temporary bare
repositories, opens no existing repository and makes no network connection.
See repro/README.md for dependency versions and runner details. From repro/,
with the JDK and jars available at these relative example paths, run:

python3 run.py --jdk deps/jdk \
  --jgit deps/jgit.jar \
  --slf4j deps/slf4j-api-2.0.18.jar \
  --javaewah deps/JavaEWAH-1.1.12.jar \
  --commons-codec deps/commons-codec-1.18.0.jar

The fixture constructs this history, where arrows show chronological order:

A (tree T) --> B (tree U) --> C (tree V)
              advertised     incoming
  1. The receiving repository contains A and B; its only branch points to B.
    Trees T, U and V are distinct and reference the same already-present blob.
  2. The incoming pack contains commit C, whose parent is B, and tree V. V is
    encoded as a REF_DELTA against T; T is omitted from the pack.
  3. Before checking the pack, an independent positive ObjectWalk from B proves
    that T is reachable, and an object-database lookup proves that T exists.
  4. A real PackParser parses the thin pack with base-object tracking enabled.
    FullConnectivityChecker.checkConnectivity then runs with strict object
    checking and B as the sole advertised have.
  5. Repeat with U as the omitted delta base, then with V sent in full. Both
    control cases are accepted.

The historical tree T is needed only as a compression base: neither C nor V
directly references it. All objects in the incoming graph are available.

The failing public code path is
FullConnectivityChecker.checkObjects, lines 191–196.
It parses the omitted base successfully, then throws because that object lacks
the walk's UNINTERESTING flag. The independent positive walk demonstrates
that lack of this flag does not establish that the base is unreachable.

Actual behavior

The historical-base case throws MissingObjectException: Missing tree from
FullConnectivityChecker.checkObjects, line 196, even though the tree exists
and is reachable from the advertised have. The current-tip-base and full-pack
controls both succeed. The runner exits successfully only after observing
this false rejection and both successful controls.

Expected behavior

Accept all three valid packs. An omitted compression base that exists and is
reachable from an advertised have should pass strict connectivity checking,
including when that reachability runs through an older commit's tree.

Relevant log output
The following is synthetic reproduction output, not server operational logs.
The complete sanitized run is in `run-output.txt`.


checker=compiled-public-source
case=historical-base base-present=true historical-T-reachable-from-B=true
result=FALSE_REJECTION Missing tree bcfda9886b1e923fbc812abb731bc52742412303
at org.eclipse.jgit.internal.transport.connectivity.FullConnectivityChecker.checkObjects(FullConnectivityChecker.java:196)
case=current-tip-base base-present=true historical-T-reachable-from-B=true
result=ACCEPT
case=full-pack base-present=true historical-T-reachable-from-B=true
result=ACCEPT
PASS: false rejection reproduced; current-tip and full-pack controls accepted
Other information

Version

Public Eclipse JGit revision 182a140566592276ac94146b26cd43242b03965c
(stable-7.7 history); implementation version
v7.7.1.202607240634-r-33-g182a14056.

The reproduction compiles the unchanged public FullConnectivityChecker.java
from that revision and verifies that this compiled class is used. Source SHA-256:
c394cf7e18934f1a0853ce02125a194e34ecbd97e9abf3fb0dfd79ae23c939f2.
No checker patch is applied.

Operating System

Linux/Unix, OpenJDK 21.0.12.1. The recorded run used an isolated, non-root,
network-disabled container with a 512 MiB memory limit and swap disabled.

More

jgit-historical-thin-base-repro.zip

The same connectivity check was also observed rejecting a blob (Missing blob
from FullConnectivityChecker.checkObjects), with no reduced reproduction yet.

Duplicate checks on 2026-11-07 found these GitHub matches for Missing tree:

  • #291 concerns concurrent
    multi-pack-index lookups. This reproduction is single-threaded and uses no
    multi-pack index.
  • #311 concerns resolving
    promised objects. This reproduction has no promisor or partial clone, and
    the rejected tree is already present.
  • #122 concerns working-tree
    add/index behavior, rather than receive connectivity.

I also checked public searches for Missing tree and FullConnectivityChecker
on the Gerrit issue tracker.
No matching indexed issue was identified; the tracker's dynamic search results
could not be inspected, so this is not a claim that no duplicate exists there.

The older Gerrit issue 1582 is related. The public
root-tree marking change
describes an incoming commit that directly references the same root tree as
an advertised commit, with that tree omitted from the pack. That change was
reverted for performance reasons.
Here the advertised, incoming and historical root trees are all different;
the historical tree is used only as an omitted delta base, and rejection is
in the final base-object loop at line 196. This is a different reproduction
in the same reachability-marking family, potentially a follow-up to that issue,
rather than a claim of an unrelated new mechanism.

The attachments contain only public source and synthetic objects/output. No
private repository history, credentials, account identifiers, operational logs,
hostnames or implementation patch are included. This is a bug report and
reproduction; a code contribution would be a separate decision.

主要语言
Java
星标
427
派生
116
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

eclipse-jgit/jgit 的其他 Issue

查看 eclipse-jgit/jgit 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。