Skip to content

Improve graph build progress logging (fallback + 2s throttle)#3165

Merged
lvca merged 1 commit intoArcadeData:mainfrom
humemai:bugfix/jvector-progress-clean
Jan 18, 2026
Merged

Improve graph build progress logging (fallback + 2s throttle)#3165
lvca merged 1 commit intoArcadeData:mainfrom
humemai:bugfix/jvector-progress-clean

Conversation

@tae898
Copy link
Contributor

@tae898 tae898 commented Jan 17, 2026

#3163

  • Add an internal, throttled progress callback so builds log progress even without a provided GraphBuildCallback.
  • Route all progress phases (validating/building/persisting) through the effective callback and throttle to avoid spam.
  • Works fine I tested locally.
  • Btw I also did 5s, instead of 2s, and didn't work well so I set it to 2s.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @tae898, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience during graph build operations by guaranteeing that progress updates are always visible, even when a custom callback isn't supplied. It implements a default, throttled logging mechanism that provides timely, yet not overly verbose, updates across all stages of the build process, from validation to persistence. This ensures users are kept informed without overwhelming the logs.

Highlights

  • Fallback Progress Logging: Introduced an internal, throttled progress callback that logs graph build progress every 2 seconds if no GraphBuildCallback is explicitly provided by the caller.
  • Unified Progress Reporting: All graph build phases (validating, building, persisting) now route their progress updates through a single 'effective' callback, ensuring consistent reporting and throttling.
  • Throttling Mechanism: The progress logging is throttled to prevent spam, only emitting logs when actual progress is made, a 2-second interval has passed, or a phase reaches completion.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a fallback progress logger for graph builds, which is throttled to avoid spamming logs. This is a good improvement for observability. All progress reporting phases are now routed through this new mechanism. My review focuses on a potential concurrency issue in the implementation of the throttled logger.

Comment on lines +791 to +811
} else {
final long[] lastLogTimeMs = {System.currentTimeMillis()};
final int[] lastLoggedProcessed = {-1};
effectiveGraphCallback = (phase, processedNodes, totalNodes, vectorAccesses) -> {
if (totalNodes <= 0)
return;

final long now = System.currentTimeMillis();
final boolean progressed = processedNodes != lastLoggedProcessed[0];
final boolean timeElapsed = now - lastLogTimeMs[0] >= 2000;
final boolean reachedEnd = processedNodes >= totalNodes && lastLoggedProcessed[0] != totalNodes;
final boolean shouldLog = progressed && (timeElapsed || reachedEnd);

if (shouldLog) {
LogManager.instance().log(this, Level.INFO,
"Graph build %s: %d/%d (vector accesses=%d)", phase, processedNodes, totalNodes, vectorAccesses);
lastLogTimeMs[0] = now;
lastLoggedProcessed[0] = processedNodes;
}
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The use of long[] and int[] as mutable containers for lastLogTimeMs and lastLoggedProcessed is not thread-safe. The effectiveGraphCallback is invoked from both the main build thread (during validation) and a separate progress monitor thread (during building). This can lead to race conditions and incorrect throttling behavior. To ensure thread safety, you should use java.util.concurrent.atomic.AtomicLong and java.util.concurrent.atomic.AtomicInteger instead.

Additionally, the throttle duration 2000 is a magic number. It would be better to extract it into a named constant for improved readability and maintainability, for example private static final int BUILD_PROGRESS_LOG_THROTTLE_MS = 2000;.

    } else {
      final java.util.concurrent.atomic.AtomicLong lastLogTimeMs = new java.util.concurrent.atomic.AtomicLong(System.currentTimeMillis());
      final java.util.concurrent.atomic.AtomicInteger lastLoggedProcessed = new java.util.concurrent.atomic.AtomicInteger(-1);
      effectiveGraphCallback = (phase, processedNodes, totalNodes, vectorAccesses) -> {
        if (totalNodes <= 0)
          return;

        final long now = System.currentTimeMillis();
        final boolean progressed = processedNodes != lastLoggedProcessed.get();
        final boolean timeElapsed = now - lastLogTimeMs.get() >= 2000;
        final boolean reachedEnd = processedNodes >= totalNodes && lastLoggedProcessed.get() != totalNodes;
        final boolean shouldLog = progressed && (timeElapsed || reachedEnd);

        if (shouldLog) {
          LogManager.instance().log(this, Level.INFO,
              "Graph build %s: %d/%d (vector accesses=%d)", phase, processedNodes, totalNodes, vectorAccesses);
          lastLogTimeMs.set(now);
          lastLoggedProcessed.set(processedNodes);
        }
      };
    }

@mergify
Copy link
Contributor

mergify bot commented Jan 17, 2026

🧪 CI Insights

Here's what we observed from your CI run for 7ea6a6b.

🟢 All jobs passed!

But CI Insights is watching 👀

@lvca lvca merged commit 6dbeec9 into ArcadeData:main Jan 18, 2026
11 of 13 checks passed
@lvca
Copy link
Contributor

lvca commented Jan 18, 2026

Great, thanks!

@lvca lvca added the enhancement New feature or request label Jan 18, 2026
@lvca lvca added this to the 26.1.1 milestone Jan 18, 2026
@tae898 tae898 deleted the bugfix/jvector-progress-clean branch January 18, 2026 10:46
robfrank pushed a commit that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants