Gaffer icon indicating copy to clipboard operation
Gaffer copied to clipboard

Use depth limit rather than timeout on NamedOperationResolver

Open tb06904 opened this issue 1 year ago • 1 comments

The NamedOperationResolver uses a timeout to control how long it will try resolve from cache, this is to stop infinite loops due to nested operations.

A better approach for this would be to implement a depth limit instead that controls how nested into a NamedOperation the resolver will go. This approach prevents infinite loops but also ensures the resolver succeeds under more circumstances and won't get stuck or timeout before finishing.

Originally posted by @GCHQDeveloper314 in https://github.com/gchq/Gaffer/pull/3148#discussion_r1464815898

tb06904 avatar Jan 24 '24 14:01 tb06904

In addition to this, there's a problem with the logs created by this code. Every time it runs the following is logged:

graph.hook.NamedOperationResolver INFO  - Starting ResolverTask with timeout: 1MINUTES
graph.hook.NamedOperationResolver INFO  - finished ResolverTask

These shouldn't be at INFO level.

GCHQDeveloper314 avatar Feb 15 '24 10:02 GCHQDeveloper314