Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Non-Transaction Write is not allowing the configuration of max parallelization

Aperta
#187 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java
Ambito
api

Direzione di ricerca

Inizia da src/main/java/dev/openfga/sdk/api/configuration/ClientWriteOptions.java e dal percorso di scrittura non transazionale intorno alle righe 415-417 di OpenFgaClient.java. Confronta la configurazione e i valori predefiniti Java con le implementazioni di riferimento in Go, JS e .NET; il lavoro è completato quando maxParallelRequests è configurabile e la dimensione del blocco della transazione usa il valore predefinito previsto senza modificare il comportamento di scrittura esistente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Please do not report security vulnerabilities here. See the Responsible Disclosure Program.

Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible.

By submitting an issue to this repository, you agree to the terms within the OpenFGA Code of Conduct.

Description

Provide a clear and concise description of the issue, including what you expected to happen.

The Java SDK ClientWriteOptions https://github.com/openfga/java-sdk/blob/main/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteOptions.java#L17 do not expose a method to set the parallization for non-transactional writes.

Equivalent JS interface: https://github.com/openfga/js-sdk/blob/main/client.ts#L190-L196
Equivalent .NET interface: https://github.com/openfga/dotnet-sdk/blob/main/src/OpenFga.Sdk/Client/Model/ClientWriteOptions.cs#L53
Equivalent Go interface: https://github.com/openfga/go-sdk/blob/main/client/client.go#L1416-L1429

The maxParallelRequests is supposed to define how many requests are sent in paralllel.

When your application sends multiple non-transactional write requests (let's say you send N of them), the SDK doesn't send them all individually. Instead, it groups them into smaller batches and sends these batches with a controlled amount of parallelization.

Here's how it should work:

  1. Batching Requests:

    • The SDK first divides your N requests into M "chunks" or batches.
    • The size of each chunk is determined by the transaction chunk size, which defaults to 1 request per chunk.
    • So, if you have 100 requests and the default chunk size is 1, you'll end up with 100 individual chunks (M = 100 / 1 = 100).
    • The formula for calculating M is: $M = \text{integer}(\text{N / transaction chunk size} + 1)$. The "+1" ensures that any remainder requests also get their own chunk.
  2. Limited Parallel Processing (Worker Queue):

    • Once the requests are batched, the SDK sends them out with limited parallelization. This means it doesn't try to send all M chunks at once.
    • It only allows a maximum number of requests to be active (in progress) at any given time. This limit is called maxParallelRequests, and it defaults to 10.
    • Think of it like a worker queue:
      • The SDK starts by sending out up to 10 requests simultaneously (if M is 10 or more).
      • As soon as any of those active requests finishes, the SDK immediately sends out the next request from the queue. It doesn't wait for all 10 active requests to complete before sending more. This keeps the processing flow continuous and efficient.
      • Note: that this queue is per-Write request, so we're not queuing all the requests in the SDK.

In essence, the SDK intelligently batches your non-transactional writes and processes them in a controlled, concurrent manner to optimize performance without overwhelming the system.

Alt SDK implementations of the feature:

Additionally, the Java SDK seems to be using the DEFAULT_MAX_METHOD_PARALLEL_REQS for the transaction chunksize, confusing the two: https://github.com/openfga/java-sdk/blob/main/src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java#L415-L417. Max chunk size should default to 1 if not set: https://github.com/openfga/dotnet-sdk/blob/main/src/OpenFga.Sdk/Client/Client.cs#L195-L197

Version of SDK

v0.8.3

Version of OpenFGA (if known)

N/A

OpenFGA Flags/Custom Configuration Applicable

N/A

Reproduction

Detail the steps taken to reproduce this error, what was expected, and whether this issue can be reproduced consistently or if it is intermittent.

  1. Initialize OpenFgaClient with openfga_sdk.ClientConfiguration parameter api_host=127.0.0.1, credentials method client_credentials
  2. Invoke method read_authorization_models
  3. See exception thrown
Sample Code the Produces Issues
Backtrace (if applicable)
Expected behavior

When Write is called in non-transaction mode, the SDK should

Additional context
Lingua principale
Java
Stelle
55
Fork
26
Merge medio
1g 22h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openfga/java-sdk

Tutte le issue di openfga/java-sdk

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.