Page Profiler transient reads still trigger “Commands out of sync” during shutdown
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
Direzione di ricerca
Inizia da inc/manager.php, inc/v2/PageProfiler/Profile.php e inc/v2/PageProfiler/Storage/Transients.php per tracciare il buffering di shutdown fino alle letture di transient. Esegui tests/test-lazyload-viewport.php, quindi riproduci il problema su Optimole 4.2.10 con Page Profiler e transient storage, ispezionando l’ordine di shutdown e lo stato di output-buffer. Il lavoro è completato quando è stato identificato lo stato della connessione che lo attiva, il percorso di shutdown non emette più gli errori e la coverage esercita il caso di integrazione pertinente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Optimole can emit recurring WordPress database errors while processing frontend output during shutdown. Page Profiler transient reads are expected to complete without database errors, but the reported requests produce Commands out of sync; you can't run this command now messages for profile keys. The errors recur daily and fill the site’s error logs.
Customer context
- Product / area: Optimole WordPress plugin, Page Profiler and frontend output replacement
- Version: Customer’s installed version is unknown; inspected repository version is 4.2.10
- Environment: WordPress with profiler data stored in transients; the trace indicates no persistent external object-cache storage on this path
- Integration / third party: Unknown from available evidence
- Reported error / symptom: Repeated MySQL
Commands out of syncerrors during shutdown-time Page Profiler transient reads - Impact: Daily database-error log growth on frontend traffic
Reproduction notes
Reported reproduction:
- Serve normal frontend pages with Optimole output replacement and Page Profiler active.
- Inspect the WordPress database-error log after page requests.
- Observe repeated
Commands out of syncentries for_transient__oprof_...reads whose stack runs throughwp_ob_end_flush_all, Optimole’s output callback, and Page Profiler storage.
The failure was observed repeatedly in production logs but was not reproduced locally. The installed plugin version and the request condition that first desynchronizes the database connection were not provided.
Diagnosis
Conclusion
The reported runtime traces confirm that Optimole’s output-buffer callback reaches Page Profiler transient reads during WordPress shutdown and that those reads surface repeated MySQL Commands out of sync errors. The code contains the exact reachable call chain and transient-key format shown in the logs. This is a recurrence of the behavior tracked in closed issue #1014, now explicitly visible in Page Profiler storage. The evidence confirms the failing Optimole path, although it does not identify which earlier database operation first leaves the connection desynchronized.
Where this likely occurs
- Frontend output buffering:
inc/manager.php—Optml_Manager::setup_replacer()lines 400–410 registers template buffering andclose_buffer()on shutdown atPHP_INT_MIN. - Shutdown replacement:
inc/manager.php—Optml_Manager::process_template_redirect_content()andOptml_Manager::close_buffer()lines 793–826 install the output callback, invokereplace_content(), and flush the buffer. - Profiler calls:
inc/manager.php—Optml_Manager::replace_content()lines 441–473 callsProfile::exists_all(),Profile::missing_devices(), andProfile::set_current_profile_data()for full-page replacement. - Profiler storage selection and reads:
inc/v2/PageProfiler/Profile.php—Profile::__construct()lines 89–105 selects transient storage without a persistent external object cache;Profile::exists_all(),Profile::missing_devices(),Profile::exists(), andProfile::set_current_profile_data()lines 260–347 perform the reads represented in the trace. - WordPress transient boundary:
inc/v2/PageProfiler/Storage/Transients.php—Transients::get()lines 64–72 callsget_transient()with the_oprof_prefix. - History: commit
63b93a2cintroduced shutdown buffer closure around v3.13.6. Commitbd94c770, merged asfcf052bf, changed the shutdown priority for #1014 and is present from v4.2.2 through the inspected v4.2.10. The current report postdates that release history.
Engineering notes
Closed issue #1014 covered the same user-visible database error during Optimole shutdown processing. Its mitigation only moved close_buffer() from default shutdown priority to PHP_INT_MIN; profiler and attachment-cache database operations remain inside output replacement. The current trace runs through wp_ob_end_flush_all into Optimole’s closure rather than showing Optml_Manager::close_buffer, suggesting that the priority mitigation was absent, bypassed, or unable to close the relevant buffer in the reported request. The customer’s installed plugin version is unavailable, so those alternatives cannot yet be separated.
The reported _transient__oprof_... queries align with transient-backed Page Profiler storage. The MySQL message also implies pre-existing connection state that is not identified by this stack; the evidence establishes where Optimole performs the failing query, not which component first leaves an outstanding result.
Test coverage status
tests/test-lazyload-viewport.php covers normal profiler behavior: test_lazyload_viewport() lines 63–85 invokes replace_content(), test_profile_data_storage_and_retrieval() lines 211–247 checks profile persistence, and test_viewport_data_exists_check() lines 302–311 checks exists_all(). Its storeMockProfileData() helper lines 487–505 also loads current profile data. No relevant coverage was found during inspection for close_buffer(), shutdown hook ordering, ob_end_flush(), nested output buffers, or a desynchronized database connection. PR #1021 added no automated test for its shutdown-priority change.
What to verify or explore next
- Reproduce on Optimole 4.2.10 with Page Profiler enabled, transient-backed storage, and frontend output buffering.
- Confirm the installed Optimole version associated with the supplied logs.
- Capture shutdown callback ordering and active output-buffer levels when
wp_ob_end_flush_allinvokes Optimole’s callback. - Exercise requests where output is empty when the earliest shutdown callback runs and where later callbacks emit content.
- Run the profiler suites in
tests/test-lazyload-viewport.phpalongside a shutdown/output-buffer integration case. - Compare behavior with and without a persistent external object cache.
Unknowns / follow-up
- The operation that initially places the MySQL connection in the out-of-sync state is not visible in the supplied stack.
- The customer’s exact WordPress, PHP, database, and Optimole versions are unknown.
- It is unknown whether another plugin or theme changes shutdown ordering or output-buffer state in the affected requests.
Confidence
Confidence: 88/100
Daily runtime traces repeatedly reach Optimole Page Profiler transient reads from the shutdown output-buffer callback. Repository inspection confirms that path remains reachable, while the priority-only mitigation that closed #1014 does not cover the observed trace; the exact installed plugin version and the component that initially desynchronizes MySQL remain unknown.
Source: HelpScout #3424946418
Generated by bug-report-triage (ID: bug-report-triage_6a87168d6b3146.68903490)
- Lingua principale
- PHP
- Stelle
- 73
- Fork
- 14
- Merge medio
- 2g 13h
- PR unite (30g)
- 16
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un 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 Codeinwp/optimole-wp
-
bug-report bug-report-triage crash-report
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
Codeinwp/optimole-wp#1162 ·
I maintainer di solito rispondono entro 1 giorno
-
customer report feature-request-triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
Codeinwp/optimole-wp#1161 ·
I maintainer di solito rispondono entro 1 giorno
-
bug-report bug-report-triage customer report regression
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
Codeinwp/optimole-wp#1159 ·
I maintainer di solito rispondono entro 1 giorno
-
customer report feature-request-triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
Codeinwp/optimole-wp#1151 ·
I maintainer di solito rispondono entro 1 giorno
-
bug-report bug-report-triage crash-report
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
Codeinwp/optimole-wp#1139 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Codeinwp/optimole-wp
Issue simili
-
Update the one-click "GTM4WP" Delay JS exclusion so that it also works with a custom data layer nameAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Remove Kanboard Discourse forum link from README.md and CONTRIBUTING.md, or moderate itAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug Localization
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
solana-foundation/pay-kit#341 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cline/cline#14560 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno