Shared config file is read and parsed repeatedly when creating a client
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start in src/Configuration/ConfigurationResolver.php, where ini() reads and parses the shared config file for each setting it resolves. Reproduce with the strace command in the issue and count the openat calls on the config file. Done means one client construction opens and parses the file once, and the existing configuration tests still pass. The issue leaves open how to reuse the parsed result without keeping stale config across clients, so settle that with a maintainer first.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Creating a single BedrockRuntimeClient reads the same shared config file repeatedly. ConfigurationResolver::ini() reads and parses the file for each setting it resolves.
This adds repeated filesystem and parsing work before any request is made.
Expected Behavior
I think the SDK should reuse the parsed config while resolving settings for the same client, instead of reading and parsing the same file repeatedly.
Current Behavior
The example below opens the config file for reading 14 times while constructing one client. It doesn't make any network requests.
Reproduction Steps
Install aws/aws-sdk-php version 3.401.2.
Create aws-config:
[default]
region = us-east-1
Create reproduce.php:
<?php
require 'vendor/autoload.php';
new Aws\BedrockRuntime\BedrockRuntimeClient([
'region' => 'us-east-1',
'version' => '2023-09-30',
'credentials' => ['key' => 'test', 'secret' => 'test'],
]);
On Linux, run with strace:
AWS_PROFILE=default AWS_CONFIG_FILE="$PWD/aws-config" \
strace -e trace=openat -P "$PWD/aws-config" php reproduce.php
The output contains 14 reads like:
openat(AT_FDCWD, "/path/to/aws-config", O_RDONLY) = 4
No AWS account is needed.
Possible Solution
Reuse the parsed file while resolving a client's settings. This could avoid repeated parsing during construction without requiring the SDK to retain stale configuration across later client creations.
Additional Information/Context
The same repeated parsing is present in ConfigurationResolver::ini() on master.
SDK version used
3.401.2
Environment details
PHP 8.4.25, Ubuntu 24.04.
Generated by Codex, and reviewed by @binaryfire.
- Lingua principale
- PHP
- Stelle
- 6.2k
- Fork
- 1.3k
- Merge medio
- 2g 15h
- PR unite (30g)
- 15
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aws/aws-sdk-php
-
Feature Request: Implement `__debugInfo()` on `Aws\Command` to prevent massive `var_dump` / log outputForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertafeature-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
aws/aws-sdk-php#3365 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
RDS auth tokens and presigned URLs get an expiry one hour too long during the autumn DST changeApertabug investigating p2
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
aws/aws-sdk-php#3392 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
The SDK now requires PHP 8.2 or laterForse già presa @stobrien89 l’ha presa 5 giorni fa. Apertaannouncement SECURITY
aws/aws-sdk-php#3385 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Event stream decoder drops the final event when reading it reaches EOFForse già presa @stobrien89 l’ha presa 10 giorni fa. Apertabug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 62/100
aws/aws-sdk-php#3374 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
AssumeRoleCredentialProvider replaces non-RuntimeException failures with TypeErrorForse già presa @stobrien89 l’ha presa 11 giorni fa. Apertabug pending-release
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
aws/aws-sdk-php#3370 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di aws/aws-sdk-php
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
backdrop-contrib/print#58 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
laravel/nova-issues#7008 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
FriendsOfFlarum/badges#20 ·
-
[Dashboard Redesign] Support and Documentation links should warn they'll be opened in another tabApertaModule: dashboard type: enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno