feat: add udf shared helpers and resilient error persistence#3459
Conversation
Signed-off-by: adarsh0728 <gooneriitk@gmail.com>
Signed-off-by: adarsh0728 <gooneriitk@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3459 +/- ##
==========================================
- Coverage 82.68% 82.66% -0.02%
==========================================
Files 307 307
Lines 77569 77912 +343
==========================================
+ Hits 64135 64407 +272
- Misses 12876 12948 +72
+ Partials 558 557 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: adarsh0728 <gooneriitk@gmail.com>
| /// Reconnects to a user-defined sink sidecar. See [`reconnect_source`] for the reconnect sequence. | ||
| #[allow(dead_code)] | ||
| pub(crate) async fn reconnect_sink( | ||
| socket_path: PathBuf, | ||
| server_info_path: PathBuf, | ||
| cln_token: CancellationToken, | ||
| grpc_max_message_size: usize, | ||
| retry_interval: Duration, | ||
| ) -> error::Result<SinkClient<Channel>> { | ||
| let channel = create_rpc_channel_with_interval(socket_path, retry_interval).await?; | ||
| let mut client = SinkClient::new(channel) | ||
| .max_encoding_message_size(grpc_max_message_size) | ||
| .max_decoding_message_size(grpc_max_message_size); | ||
| wait_until_sink_ready(&cln_token, &mut client).await?; | ||
| let _server_info = sdk_server_info(server_info_path, cln_token.clone()).await?; | ||
| Ok(client) | ||
| } |
There was a problem hiding this comment.
why a separate method for reconnect? can we just use the existing connect method or call it create_sink_client? similarly for other clients as well.
There was a problem hiding this comment.
will use create_sink_client and similar naming for other components
There was a problem hiding this comment.
added different clients (will be used at startup and reconnect) , may be can add a common helper like create_udf_client to avoid duplication of logic inside those helpers.. but current helpers look simple and readabale.
Signed-off-by: adarsh0728 <gooneriitk@gmail.com>
Signed-off-by: adarsh0728 <gooneriitk@gmail.com>
Summary
Introduces shared helpers, UDF-specific error classification, and safer runtime error persistence. The actual source/transformer/map/sink reconnect behaviour will be wired in follow-up PRs.
Related Issues
#3368
What Changed
create_*_clienthelpers for source, sink, source transformer, and mapper UDF clients.Behaviour Change