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

Shared config file is read and parsed repeatedly when creating a client

Aperta
#3,377 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à
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
aws, php
Ambito
cloud

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

feature-request p3

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

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 aws/aws-sdk-php

Tutte le issue di aws/aws-sdk-php

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.