-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[wip] SpiceDB reconnect behavior #18570
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
Conversation
9e07410
to
a9ec85f
Compare
New and updated dependencies detected. Learn more about Socket for GitHub ↗︎
|
261329a
to
6ed8284
Compare
8ef2955
to
f3fe53e
Compare
@@ -26,10 +28,6 @@ export class SpiceDBAuthorizer { | |||
userId: string; | |||
}, | |||
): Promise<boolean> { | |||
if (!this.client) { | |||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was really confusing in testing 🙈
And as we now require SpiceDB in every environment, we should remove it alltogether.
.toDynamicValue((ctx) => { | ||
const config = spiceDBConfigFromEnv(); | ||
if (!config) { | ||
throw new Error("[spicedb] Missing configuration expected in env vars!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We error now if the configuration is incomplete.
f3fe53e
to
6a91d0c
Compare
Rebasing the PR 🙄 |
…ng config + client call metrics)
6a91d0c
to
4f0751f
Compare
|
||
export function createInitializingAuthorizer(spiceDbAuthorizer: SpiceDBAuthorizer): Authorizer { | ||
const target = new Authorizer(spiceDbAuthorizer); | ||
const initialized = (async () => { | ||
await target.addInstallationAdminRole(BUILTIN_INSTLLATION_ADMIN_USER_ID); | ||
await target.addUser(BUILTIN_INSTLLATION_ADMIN_USER_ID); | ||
})(); | ||
})().catch((err) => log.error("Failed to initialize authorizer", err)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would hide the error and only log. Is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, good catch.
const timer = spicedbClientLatency.startTimer(); | ||
let error: Error | undefined; | ||
try { | ||
const existing = await this.client.readRelationships(v1.ReadRelationshipsRequest.create(req)); | ||
const client = this.clientProvider.getClient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could extract this into
private get client() {
return this.clientProvider.getClient();
}
/unhold |
Description
Before,
server
waited at least 120s before establishing a gRPC connection to SpiceDB again.This PR:
0.12.1
which exposes gRPC Client- and ChannelOptionsdeadline
of8s
to each call against SpiceDB to ensure we are not starving30s
ℹ️ SpiceDB config is required now, and
server
fails to start if there is no config in the env vars.Summary generated by Copilot
🤖 Generated by Copilot at 57c33a4
Add performance logging to SpiceDB client calls in
spicedb-authorizer.ts
. This helps to measure and optimize the latency of authorization checks and updates.Related Issue(s)
Fixes EXP-379
How to test
kubectl delete pod spicedb-...
Documentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold