Skip to content

Behavior of ReflectorRunnable changed in version 12.0.0 #1621

Closed
@domainname

Description

@domainname

Describe the bug

In commit 013a9b7, the behavior of ReflectorRunnable changed a little bit. A new catch block was added. See below.

} catch (ApiException e) {
if (e.getCode() == HttpURLConnection.HTTP_GONE) {
log.info(
"ResourceVersion {} expired, will retry w/o resourceVersion at the next time",
getRelistResourceVersion());
isLastSyncResourceVersionUnavailable = true;
}

Before the commit, all exceptions are caught by this

} catch (Throwable t) {
this.exceptionHandler.accept(apiTypeClass, t);
}

and exception handler will be invoked.

I'm not sure whether this behavior change is intended or not. It seems to me that exception handler should be invoked in the new catch block as well.

@yue9944882 BTW, what's the purpose of the exception handler? I plan to use it to do a pause when networking error (such as UnknownHostException) occurs, in order to avoid too frequent retries. Does this make sense? Well, I know that it is hard to add a custom exception handler for ReflectorRunnable at this point.

** Client Version **
12.0.0

** Kubernetes Version **
N/A

** Java Version **
Java 8

To Reproduce
Steps to reproduce the behavior:

Expected behavior

Exception handler should be invoked in the new catch block as well probably.

KubeConfig
N/A

Server (please complete the following information):

  • OS: Linux
  • Environment: local
  • Cloud: Azure

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions