open-policy-agent / open-policy-agent/java-opa-sdk

Keep last-good bundle on activation failure

Open
#66 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bundles services
Dominant language
Java
Stars
16
Forks
24
Avg merge
8h 17m
Merged PRs (30d)
15

Description

BundlePlugin.Bundle.activateBundle rethrows on any error during loading or store write, so a bad bundle (corrupt tar, parse failure, root violation once #63 lands) can leave the plugin in ERROR state with no policy at all. OPA Go keeps serving the previously activated bundle when activation of a new one fails.

  • On activation failure, log the error and keep the previously activated bundle live.
  • Mark the per-bundle status as failed (feeds the per-bundle status events issue) but don't tear down the existing store contents.
  • Initial activation is the special case: the first failure has no last-good to fall back on, so it still completes the initial-activation future exceptionally.
  • Tests: corrupt bundle on second activation keeps prior data; corrupt bundle on first activation still fails fast.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at BundlePlugin.Bundle.activateBundle and trace loading, store writes, activation state, and the initial-activation future. Add tests for a corrupt bundle on second activation retaining prior data and for a corrupt first activation failing fast. Done means failures mark the bundle as failed while the last-good bundle and its store contents remain live.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.