Skip to content

Go: tracing framework - #17004

Merged
JinHai-CN merged 13 commits into
infiniflow:mainfrom
JinHai-CN:fix554
Jul 16, 2026
Merged

JinHai-CN merged 13 commits into
infiniflow:mainfrom
JinHai-CN:fix554

Conversation

@JinHai-CN

@JinHai-CN JinHai-CN commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Tracing framework

@JinHai-CN JinHai-CN added the ci Continue Integration label Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d0193282-029a-4cb5-a3ab-ea0420cfdbf4

📥 Commits

Reviewing files that changed from the base of the PR and between 1964d2e and 7655c0c.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • docker/docker-compose-base.yml
  • go.mod
🚧 Files skipped from review as they are similar to previous changes (1)
  • docker/docker-compose-base.yml

📝 Walkthrough

Walkthrough

The PR updates EE server lifecycle signatures and callers, changes EE route initialization order, upgrades Go dependencies, and relocates the Jaeger service definition in the base Docker Compose file.

Changes

EE integration

Layer / File(s) Summary
Context-aware EE lifecycle
internal/server/server_ee.go, cmd/ragflow_server.go
EE startup and shutdown accept context parameters; main passes a background context, and EEServer gains a tracer provider field.
EE route initialization
internal/admin/..., internal/router/...
Admin and general router setup initialize EE routes during setup, with import formatting updates in EE router files.

Dependency updates

Layer / File(s) Summary
Go module requirement updates
go.mod
Direct and indirect dependencies are upgraded or added, including Gin, JSON, QUIC, codec, architecture, and OpenTelemetry modules.

Compose service reordering

Layer / File(s) Summary
Jaeger service placement
docker/docker-compose-base.yml
The unchanged Jaeger service block is moved after Redis and before NATS.

Estimated code review effort: 3 (Moderate) | ~15 minutes

Possibly related PRs

  • infiniflow/ragflow#16915: Updates the same EE initialization flow, including context-aware server calls and EE router hookup.

Suggested labels: 💞 feature

Suggested reviewers: qinling0210

Poem

A rabbit hops through routes anew,
With context carried safely through.
Dependencies bloom, Jaeger moves,
EE finds its proper grooves.
“Hop hop!” says Bun, “the stack is bright!” 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description has the required Summary heading but is too vague and lacks background or purpose details. Expand the Summary with the problem being solved, why tracing is needed, and any relevant background context.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: adding a Go tracing framework.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JinHai-CN
JinHai-CN marked this pull request as ready for review July 16, 2026 10:10
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 16, 2026
@JinHai-CN
JinHai-CN marked this pull request as draft July 16, 2026 10:12
@JinHai-CN
JinHai-CN marked this pull request as ready for review July 16, 2026 10:12

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/server/server_ee.go (1)

32-52: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Wire the EE lifecycle through or remove the stub. StartServer/ShutdownServer ignore ctx and serverName, and newEEServer never initializes tracerProvider, so the EE path still performs no tracing or shutdown work. Either thread these values into the implementation or drop the unused API surface.

🤖 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 `@internal/server/server_ee.go` around lines 32 - 52, Implement the EE
lifecycle in StartServer and ShutdownServer instead of leaving the stub: use ctx
and serverName to perform the intended start, tracing, and shutdown operations
through EEServer, and initialize tracerProvider in newEEServer as required. If
no implementation is available, remove the unused lifecycle API and related
fields rather than retaining no-op methods.
🧹 Nitpick comments (1)
cmd/ragflow_server.go (1)

372-377: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Use a bounded shutdown context.

context.Background() is never canceled or deadline-bound, yet it is passed to deferred shutdown. If EE or tracer teardown blocks, process shutdown can hang indefinitely. Derive a timeout context specifically for ShutdownServer and handle its returned error.

🤖 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 `@cmd/ragflow_server.go` around lines 372 - 377, Update the shutdown flow
around server.StartServer and server.ShutdownServer to derive a bounded timeout
context specifically for deferred teardown instead of reusing
context.Background(). Ensure the deferred shutdown invokes ShutdownServer with
that timeout context and handles/logs its returned error, while preserving the
existing startup error handling.
🤖 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 `@docker/docker-compose-base.yml`:
- Around line 253-267: Remove the duplicate jaeger service definition later in
the Compose file, preserving only the shown jaeger service block and its
existing configuration.

---

Outside diff comments:
In `@internal/server/server_ee.go`:
- Around line 32-52: Implement the EE lifecycle in StartServer and
ShutdownServer instead of leaving the stub: use ctx and serverName to perform
the intended start, tracing, and shutdown operations through EEServer, and
initialize tracerProvider in newEEServer as required. If no implementation is
available, remove the unused lifecycle API and related fields rather than
retaining no-op methods.

---

Nitpick comments:
In `@cmd/ragflow_server.go`:
- Around line 372-377: Update the shutdown flow around server.StartServer and
server.ShutdownServer to derive a bounded timeout context specifically for
deferred teardown instead of reusing context.Background(). Ensure the deferred
shutdown invokes ShutdownServer with that timeout context and handles/logs its
returned error, while preserving the existing startup error handling.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c1192e2e-c238-4b21-b7c1-5391f02cd178

📥 Commits

Reviewing files that changed from the base of the PR and between caa76fb and 3c46841.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • cmd/ragflow_server.go
  • docker/docker-compose-base.yml
  • go.mod
  • internal/admin/router.go
  • internal/admin/router_ee.go
  • internal/router/router.go
  • internal/router/router_ee.go
  • internal/server/server_ee.go
💤 Files with no reviewable changes (2)
  • internal/admin/router.go
  • internal/router/router.go

Comment thread docker/docker-compose-base.yml Resolved
@JinHai-CN
JinHai-CN merged commit f8474a6 into infiniflow:main Jul 16, 2026
4 of 5 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant