You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "naivedogger (via GitHub)" <gi...@apache.org> on 2026/10/21 10:16:01 UTC

[PR] [rust] Align client logging coverage with Java conventions [fluss]

naivedogger opened a new pull request, #4783:
URL: https://github.com/apache/fluss/pull/4783

   Generated-by: OpenAI Codex following the project AGENTS.md guidelines.
   
   ### Purpose
   
   Linked issue: close #4780
   
   Rust client diagnostics omit write lifecycle events and log some fetch failures
   below the corresponding Java level. Define the logging conventions and fill
   these gaps so application-collected logs retain failure context and expose
   batch/lifecycle detail when DEBUG or TRACE is enabled.
   
   This PR implements the event and convention scope of the first logging issue:
   writing, log fetching, and connection setup in the shared Rust core. It does not
   claim complete parity with every Java diagnostic event.
   
   Logger calls still run synchronously through the existing `log` facade. The
   application's logger determines whether output I/O is synchronous or queued;
   this PR adds no logger, async queue, or automatic log files. Applications must
   configure a logger to collect these events.
   
   The second issue and follow-up PR will cover backend selection, default log
   location, background file writes, bounded queues, file rotation and retention,
   initialization across language bindings, coexistence with an existing logger,
   and shutdown flushing. Queue-full behavior, flush timeout, and storage defaults
   remain design decisions for that work. Global correlation IDs, complete
   batch-to-RPC tracing, and slow/stall detection are outside this two-issue scope.
   
   ### Brief change log
   
   - Document event levels, Java references, shared core ownership, safe context,
     and filtering. Link the guide from contributing documentation and AGENTS.md.
   - Add writer, sender, batch completion, sequence assignment, and connection
     lifecycle events. Include existing batch/bucket identifiers in write failures
     and retries.
   - Align fetch failures and unexpected sender failures with Java's ERROR level,
     while keeping write retries and final batch failures at WARN.
   - Add test-only log capture and verify operation results alongside logging.
   
   ### Tests
   
   Verified on macOS aarch64 with rustc 1.96.1:
   
   - `cargo test --all-targets --workspace --exclude fluss_python --exclude fluss-cpp --exclude fluss_nif --locked`: 866 passed, no failures or ignored tests.
   - `cargo check -p fluss_python -p fluss_nif -p fluss-cpp --locked`: passed.
   - `cargo clippy --all-targets --workspace --exclude fluss_python --exclude fluss-cpp --exclude fluss_nif --locked -- -D warnings`: passed.
   - `cargo fmt --all -- --check` and `git diff --check`: passed.
   - `npm run build -- --no-minify` in `fluss-rust/website`: passed.
   - `./mvnw -B spotless:check`: passed.
   - `JAVA_HOME=<JDK 11> ./mvnw -B validate`: passed, including Checkstyle and license checks.
   
   Regression checks cover retry exhaustion and non-retriable write failure,
   retriable fetch metadata invalidation and authorization errors, single terminal
   batch logging, idempotent close, level filtering, and connection handshake/auth
   success or failure with no input credentials in the logs.
   
   Full Maven `clean verify` ran in a clean source snapshot with JDK 11 and a
   JDK 17 toolchain. It stopped at the unchanged `RemoteLogITCase`: the `true, dir2`
   and `false, dir2` cases timed out waiting for replica table metadata. A targeted
   rerun passed all four parameters once and reproduced the `false, dir2` failure
   on its second execution. Full Maven verification remains incomplete; later
   reactor modules were not reached. No Java source or Maven configuration changes
   are included in this PR.
   
   The C++ build script reports an Apple `ar -D` capability-probe warning; the build
   succeeds. Rust real-cluster integration tests, language-host runtime tests, throughput
   benchmarks, MSRV, and coverage measurement were not run.
   
   ### API and Format
   
   No public API, protocol, persisted format, serialization field order, dependency,
   or configuration default changes. Logging content and levels intentionally change;
   error propagation, retry decisions, and shutdown behavior remain unchanged.
   
   Shared core events apply to Python, C++, and Elixir calls through the core.
   Binding-specific diagnostics and logger integration remain unchanged.
   
   New routine write diagnostics use TRACE/DEBUG macros with existing identifiers;
   flush also takes a timestamp. Enabled logs incur formatting/backend costs, and
   failure loops retain per-attempt output. No throughput claim is made.
   
   ### Documentation
   
   Add `developer-guide/logging.md` and link it from the contribution guide, website
   sidebar, and AGENTS.md. The guide distinguishes shared event generation from
   application-owned logging configuration.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rust] Align client logging coverage with Java conventions [fluss]

Posted by "naivedogger (via GitHub)" <gi...@apache.org>.
naivedogger commented on PR #4783:
URL: https://github.com/apache/fluss/pull/4783#issuecomment-6313791234

   @luoyuxia @fresh-borzoni @loserwang1024 Could you please take a look when you have time? I'd appreciate your feedback on the logging conventions and coverage.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rust] Align client logging coverage with Java conventions [fluss]

Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on code in PR #4783:
URL: https://github.com/apache/fluss/pull/4783#discussion_r4338936492


##########
fluss-rust/crates/fluss/src/rpc/server_connection.rs:
##########
@@ -906,6 +920,107 @@ mod tests {
         }
     }
 
+    #[tokio::test]
+    async fn connection_lifecycle_logs_preserve_errors_and_omit_credentials() {
+        use crate::error::FlussError;
+        use crate::proto::{ApiVersionsResponse, AuthenticateResponse, ErrorResponse};
+        use prost::Message;
+
+        // Fail the version handshake, fail authentication, then establish a connection.
+        for fail_at in [Some(0), Some(1), None] {
+            let logs = crate::test_utils::log_capture::LogCapture::new(log::LevelFilter::Trace);

Review Comment:
   Do we need to test log-level filtering here, given that Rust’s standard `log` crate is already mature and well-tested?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org