-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
Description
Hihi
On the latest-version, seeing a lot of this in the logs:
E, [2023-02-14T16:46:29.307789 #87679] ERROR -- : cannot find the current context.
This is coming from this line which may be mistakenly hiding a bug?
The code is:
def current_entity
if entity = Thread.current[LOCAL_KEY]
entity
else
handle_context_missing
end
end
But when I run Thread.current[LOCAL_KEY] I get uninitialized constant XRay::NetHttp::HTTPInstanceInterceptor::LOCAL_KEY which I imagine is unintended.
Ah, but further research shows this is coming from the Unleash gem I use which runs on a scheduled task on it's own Thread.
So Unleash fires, calling http-fetch which get's intercepted by XRay which throws an error because no context is set.
I've also found an undocumented context_missing option of IGNORE_ERROR which silences the issue.