Skip to content

Aa policy cache#226

Open
jacomago wants to merge 6 commits into
ChannelFinder:masterfrom
jacomago:aa-policy-cache
Open

Aa policy cache#226
jacomago wants to merge 6 commits into
ChannelFinder:masterfrom
jacomago:aa-policy-cache

Conversation

@jacomago
Copy link
Copy Markdown
Contributor

@jacomago jacomago commented May 29, 2026

This changes how the policies are fetched from the archiver. Instead on every "processing", it is scheduled to a default of every hour and the result cached.

This separates the processing vs the fetching of policies from the archivers.

@jacomago jacomago force-pushed the aa-policy-cache branch 2 times, most recently from bf01d66 to a5f03a0 Compare June 2, 2026 07:41
@jacomago jacomago self-assigned this Jun 2, 2026
@jacomago jacomago marked this pull request as ready for review June 2, 2026 07:44
georgweiss
georgweiss previously approved these changes Jun 2, 2026
simon-ess
simon-ess previously approved these changes Jun 2, 2026
@anderslindho
Copy link
Copy Markdown
Contributor

Nitpick but please configure your agents on commit message subject lengths - you are again overflowing

if (!namesToStatuses.isEmpty()) {
verify(archiverService, times(1)).getStatusesViaGet(anyString(), anyList());
verify(archiverService).getStatusesViaGet(anyString(), anyList());
verify(archiverService).getStatusesViaPost(anyString(), anyList());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should be split out. It is a fix in what should be a no-op refactor commit. And the conventional commit category here (for the refactor) should prob be refactor(tests) rather than test(...).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure exactly what you mean.

Comment on lines +124 to +127
"PostSupportArchivers",
postSupportArchivers.toString(),
"PolicyRefreshIntervalSeconds",
String.valueOf(policyRefreshIntervalSeconds),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These names should be improved, esp the first one (latter just add Cache somewhere)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to make more consistent.

jacomago and others added 5 commits June 2, 2026 12:52
 remove duplicate stubs, add missing post verification

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Policies are fetched once at startup (@PostConstruct) and refreshed on a
configurable fixed delay (aa.policy_refresh_interval_seconds, default 1 h)
rather than on every process() call. process() now reads a volatile snapshot,
so policy fetches can no longer block or fail mid-run. processorInfo() exposes
LastPolicyRefresh and per-archiver policy counts for observability.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Create a base class AAChannelProcessorBaseIT with shared fields (archiveProperty, activeProperty, inactiveProperty),
@MockitoBean/@Autowired declarations, @beforeeach primeCache(), and the
paramableAAChannelProcessorTest helper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jacomago jacomago dismissed stale reviews from simon-ess and georgweiss via ca32ec8 June 2, 2026 11:45
Make a method cachedPoliciesRepresentation to make
printing of cachedPolicies more DRY
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 3, 2026

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.

4 participants