Remove extraneous App Session watch logic#40092
Conversation
|
@fspmarshall Creating sessions in the WebUI with this PR results in a warning log: In the Auth service, I'm also seeing multiple logs back to back, since we only claim a read lock: It seems to me like this fallback would be more performant than setting up a resource watcher, but I'm concerned about log spam and the sync issue above. wdyt? Edit: Actually we were seeing these logs in v15 as well since |
|
@Joerger The fallback logic was originally introduced to mitigate a bug, however I'm not opposed to having the fallback logic graduate to being 'expected behavior'. And yeah, I think in that case it's worth downgrading that log line to debug. |
40736c1 to
5ee416b
Compare
Changelog: Improve efficiency of App Access session creation
This PR removes extraneous App Session and Snowflake Session client-side watcher logic.
In the original App Access implementation, it was possible for an App session to be created without it propagating to the Proxy's cache before the user attempted to use it. This race condition was handled with an Auth client watcher immediately after calling
CreateAppSession. IIUC, the logic here was that if the app session propagated to the client watcher, it should have propagated to the proxy cache shortly before, thus avoiding the race condition.This racy condition is no longer possible with the introduction of the cache fallback mechanism for web session in v15. The Proxy will simply check Auth itself if it doesn't find the web session in the cache.
In fact, in v15 this watcher wasn't even doing anything since the
GetAppSessioncall at the start ofWaitForAppSessionwould immediately fall back to the auth cache, and then the auth backend.Note: as the above fix wasn't added until v15, this change will not be backported to avoid compatibility issues with old Proxy and Snowflake DB services.