Skip to content

Settings: a failed read no longer warns, and the supervisor reconnects to log - #1995

Merged
fog-workflows[bot] merged 2 commits into
working-1.6from
fix/settings-read-after-disconnect
Oct 28, 2026
Merged

fog-workflows[bot] merged 2 commits into
working-1.6from
fix/settings-read-after-disconnect

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Fixes #1994.

Problem

Every FOG service restart writes Trying to access array offset on false at FOGBase.php:3747 and :3752 to servicemaster.log.

Cause

Change

  • Both loaders treat a non-array result as a failed read. A stale entry keeps its value. A failed bulk load no longer empties the cache or writes an empty cache file.
  • Service_Log_message() reopens the link before it formats the time. Service_persist() still closes it before every fork, so no child inherits it.

Verification

Reach

RC18 users get this in the next RC. An rc-1.6.0 port follows.

🤖 Generated with Claude Code

…s to log

PDODB::get() answers false when a read fails. getSetting() and
_loadAllSettings() cast that to an array and iterated it; (array) false is
[false], so each failed read wrote "Trying to access array offset on false"
at FOGBase.php:3747 and :3752. A failed bulk load also emptied the cache in
refreshSettingsCache() and could persist an empty cache file. Both loaders
now treat a non-array result as a failure: a stale entry keeps its value and
is retried next call, and a failed bulk load replaces nothing.

The daemon supervisor is where the failures came from. On RC18 it shares a
socket with its child, so its reads fail while the child starts or stops.
Since #1930 it closes that socket before each fork, but its next log line
can still read a setting -- the log gate, once the cache entry is past its
TTL. The #1930 commit said the supervisor makes no queries after the fork;
that was wrong. Service_Log_message() now reopens the link first, the same
call the child makes. Service_persist() still closes it before every fork,
so no child inherits it.

tests/settings-read-failure.test.php runs the real FOGBase on a DB stub that
fails every read; on the unfixed tree it reports the reporter's exact
warnings. A shadow-tree run of the real Service_Log_message() after
disconnect(): unfixed, 3 warnings and the link left closed; fixed, none and
the link open.

Fixes #1994

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
global-class-prefix requires it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fog-workflows
fog-workflows Bot added this pull request to the merge queue Oct 28, 2026
Merged via the queue into working-1.6 with commit 0f76cf5 Oct 28, 2026
10 checks passed
@fog-workflows
fog-workflows Bot deleted the fix/settings-read-after-disconnect branch October 28, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant