Xuanwo commented on code in PR #5746:
URL: https://github.com/apache/opendal/pull/5746#discussion_r1990454044
##########
bindings/java/src/executor.rs:
##########
@@ -186,10 +188,11 @@ pub(crate) fn executor_or_default<'a>(
///
/// This function could be only when the lib is loaded.
unsafe fn default_executor<'a>(env: &mut JNIEnv<'a>) -> Result<&'a Executor> {
- RUNTIME.get_or_try_init(|| {
+ Ok(RUNTIME.get_or_init(|| {
make_tokio_executor(
env,
available_parallelism().map(NonZeroUsize::get).unwrap_or(1),
)
- })
+ .expect("Failed to initialize default executor")
Review Comment:
> since we have this comment I wonder its ok, because maybe it is load time
things, if error happens means this is not load?
Yes, this is exactly why we need errors. A panic here could completely break
the user's application if they haven't protected against it. OpenDAL will
become part of the user's own business logic, and no user will rely solely on
OpenDAL. We must ensure that we do not break their applications.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]