-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go/adbc/driver/flightsql: When CookiesMiddleware is enabled, DO_GET requests have a different set of cookies #1194
Comments
The JDBC driver is known to be wrong in the sense that it always reuses the same client for metadata and data requests, by assuming that the same server is used for both. The ADBC implementation properly creates a new client. However then it will reauthenticate and everything. It does cache the clients, though. Perhaps what we should do is:
|
Ahhh right, I remember that bug on the JDBC side. Yeah that makes sense! it does seem like the cache is working since the session_id matches between I think copying over cookies would suffice. The auth token and headers are already getting passed along correctly based on both |
Relevant conversation in the JDBC driver: apache/arrow#38576. Maybe this should also be configurable for ADBC drivers. |
Yes, IMO the ideal behavior is to copy over the cookies/auth tokens to start with, but let them diverge from there if the server ends up setting something else or requesting authentication |
@aiguofer I can put this on my list of things to do, but if you want to take a stab at implementing this, go for it and I'll happily review the code! I'm currently travelling at a conference this week, but I'll try to get to this next week. |
Awesome sounds great! I'd love to take a stab at it but I have no experience working in Go and unfortunately don't have the time to learn it right now. |
…39838) ### Rationale for this change This is needed for apache/arrow-adbc#1194 to facilitate better connection handling for flight clients in ADBC by copying the existing cookies over when creating a sub-client. ### What changes are included in this PR? Creating a `Clone` method on the `CookieMiddleware` so that a user can create and hold a reference to a specific cookie middleware instance and then create new ones on the fly that copy over the existing cookies at that moment. ### Are these changes tested? Yes. ### Are there any user-facing changes? No * Closes: #39837 Authored-by: Matt Topol <zotthewizard@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
Closes #1194 This also bumps our dependency up to arrow v16
…che#1497) Closes apache#1194 This also bumps our dependency up to arrow v16
…ware (apache#39838) ### Rationale for this change This is needed for apache/arrow-adbc#1194 to facilitate better connection handling for flight clients in ADBC by copying the existing cookies over when creating a sub-client. ### What changes are included in this PR? Creating a `Clone` method on the `CookieMiddleware` so that a user can create and hold a reference to a specific cookie middleware instance and then create new ones on the fly that copy over the existing cookies at that moment. ### Are these changes tested? Yes. ### Are there any user-facing changes? No * Closes: apache#39837 Authored-by: Matt Topol <zotthewizard@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
…ware (apache#39838) ### Rationale for this change This is needed for apache/arrow-adbc#1194 to facilitate better connection handling for flight clients in ADBC by copying the existing cookies over when creating a sub-client. ### What changes are included in this PR? Creating a `Clone` method on the `CookieMiddleware` so that a user can create and hold a reference to a specific cookie middleware instance and then create new ones on the fly that copy over the existing cookies at that moment. ### Are these changes tested? Yes. ### Are there any user-facing changes? No * Closes: apache#39837 Authored-by: Matt Topol <zotthewizard@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
…ware (apache#39838) ### Rationale for this change This is needed for apache/arrow-adbc#1194 to facilitate better connection handling for flight clients in ADBC by copying the existing cookies over when creating a sub-client. ### What changes are included in this PR? Creating a `Clone` method on the `CookieMiddleware` so that a user can create and hold a reference to a specific cookie middleware instance and then create new ones on the fly that copy over the existing cookies at that moment. ### Are these changes tested? Yes. ### Are there any user-facing changes? No * Closes: apache#39837 Authored-by: Matt Topol <zotthewizard@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
…#39838) ### Rationale for this change This is needed for apache/arrow-adbc#1194 to facilitate better connection handling for flight clients in ADBC by copying the existing cookies over when creating a sub-client. ### What changes are included in this PR? Creating a `Clone` method on the `CookieMiddleware` so that a user can create and hold a reference to a specific cookie middleware instance and then create new ones on the fly that copy over the existing cookies at that moment. ### Are these changes tested? Yes. ### Are there any user-facing changes? No * Closes: #39837 Authored-by: Matt Topol <zotthewizard@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
I noticed that when cookies are enabled, DO_GET requests seem to be on their own set of cookies while other methods (only tested with GET_FLIGHT_INFO and DO_ACTION) seem to be on another set of cookies.
For example, here's a sequence of logs from establishing a connection and issuing a query, setting a "session_id" in the cookies if not already provided in the cookies:
Through JDBC:
Through ADBC:
The text was updated successfully, but these errors were encountered: