petrov-mg commented on code in PR #10482: URL: https://github.com/apache/ignite/pull/10482#discussion_r1083058621
########## modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java: ########## @@ -626,21 +540,10 @@ private <T, R> ComputeTaskInternalFuture<R> startTask( else taskClsName = taskCls != null ? taskCls.getName() : taskName; - // Get values from thread-local context. - Map<GridTaskThreadContextKey, Object> map = thCtx.get(); - - if (map == null) - map = EMPTY_ENUM_MAP; - else - // Reset thread-local context. - thCtx.set(null); - - if (map.get(TC_SKIP_AUTH) == null) + if (!opts.isAuthenticationDisabled()) ctx.security().authorize(taskClsName, SecurityPermission.TASK_EXECUTE); - Long timeout = (Long)map.get(TC_TIMEOUT); - - long timeout0 = timeout == null || timeout == 0 ? Long.MAX_VALUE : timeout; + long timeout0 = opts.timeout().orElse(Long.MAX_VALUE); Review Comment: Fixed. I think it's better not to return optional in TaskExecutionOptions#timeout() at all. -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org