Skip to content
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

Session config lost if error is returned on first query after two successive reconnects #1195

Open
msullivan opened this issue Jan 4, 2024 · 2 comments · Fixed by #1340
Open

Comments

@msullivan
Copy link
Member

Here, I set a session config variable. Then, I twice run a query that errors (here, select asdf), while restarting edgedb between commands so that the CLI needs to reconnect. If I do this twice in a row, the session config gets lost!
If I only do it once, then it manages to keep the config.

This is probably somewhat marginal for end users, but I hit it in my development workflow because I'm constantly running queries that don't work and then restarting the server to run a hopefully fixed version!

_localdev:edgedb> configure session set apply_access_policies := false;
OK: CONFIGURE SESSION

_localdev:edgedb> select cfg::Config.apply_access_policies;
[false]

_localdev:edgedb> select asdf;
Reconnecting...
error: InvalidReferenceError: object type or alias 'default::asdf' does not exist

_localdev:edgedb> select asdf;
Reconnecting...
error: InvalidReferenceError: object type or alias 'default::asdf' does not exist

_localdev:edgedb> select cfg::Config.apply_access_policies;
[true]
@msullivan
Copy link
Member Author

I'm not sure if this case was a regression or if this was always fiddly (see #1183)

@msullivan
Copy link
Member Author

Aha! And it also loses the automatically set session_idle_transaction_timeout! I've been haunted by session idle transaction timeouts for years, and I had still been getting it even after we were pretty sure we had squashed it in the server!

_localdev:edgedb> select cfg::Config.session_idle_transaction_timeout;
{<duration>'0:00:10'}
_localdev:edgedb> start transaction;
OK: START TRANSACTION
_localdev:edgedb[tx]> 
Reconnecting...
_localdev:edgedb> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant