Quick revision
The short answer
Frameworks tighten defaults, like rejecting circular references in Spring Boot 2.6, to push teams away from bad designs, and older code breaks on upgrade. The escape hatch, spring.main.allow-circular-references, let teams upgrade first and fix later, but across a large organisation such hatches tend to become permanent. So we should read release notes for default changes in every upgrade plan, track escape hatch usage across the whole fleet with deadlines to remove it, and use shared starters to apply company-wide decisions consistently.
What to remember
In this answer, we used the circular references change as a lesson in managing upgrades at scale. Frameworks tighten defaults to prevent bad designs, and old code breaks. Escape hatches let teams upgrade first and fix later, but without an owner and a date they become permanent. We saw three practices that prevent this: reading release notes specifically for default changes, tracking escape hatch use across the fleet with deadlines, and using a shared starter to apply decisions consistently.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Frameworks tighten defaults, like rejecting circular references in Spring Boot 2.6, to push teams away from bad designs, and older code breaks on upgrade. The escape hatch, spring.main.allow-circular-references, let teams upgrade first and fix later, but across a large organisation such hatches tend to become permanent. So we should read release notes for default changes in every upgrade plan, track escape hatch usage across the whole fleet with deadlines to remove it, and use shared starters to apply company-wide decisions consistently.
Why this question is asked
Questions at the twenty-year level are rarely about one property. This one uses the circular references change as a case study and asks what we learned about running upgrades for hundreds of services. Interviewers want to hear how a senior engineer thinks about framework defaults, technical debt that hides behind configuration, and the mechanisms that keep a large organisation current. In this answer, we will look at why frameworks change defaults, what an escape hatch really costs over time, and three practices: reading for default changes, tracking escape hatches across the fleet and encoding decisions in shared starters.
1Why Frameworks Tighten Defaults
A default is the behaviour we get when we configure nothing. For most teams, the default is the behaviour, because few people read every property. Framework authors know this, so changing a default is the strongest tool they have to change how millions of applications are built.
For years Spring silently resolved circular references between field-injected beans. That was convenient, but it hid tangled designs and caused subtle bugs with proxies. In Spring Boot 2.6 the team flipped spring.main.allow-circular-references to false. Every application with a cycle now failed at startup. Similar tightening happens often: Spring Boot 3 moved from javax to jakarta packages, path matching became stricter, and security defaults change regularly. Each change is good for new code and painful for old code.
So the first lesson is to expect it. A large codebase will keep accumulating designs that a future default rejects, and an upgrade plan that assumes 'just bump the version' will fail at the first such change.
2The Hidden Cost of an Escape Hatch
Framework authors usually provide an escape hatch, a setting that restores the old behaviour. It exists for a good reason: it separates the upgrade from the cleanup. A team can move to the new version, get the security fixes, and fix its cycles later.
The catch is the word later. In a large organisation, once the application starts, the pressure is gone. The property sits in application.properties, new developers copy it into new services because 'that is how we do it', and the number of cycles grows because nothing stops it. Two years later the escape hatch is load-bearing, and when the framework finally deprecates or removes it, the cleanup is bigger than it would ever have been at the start.
- Upgrade breaks startupBoot 2.6 rejects existing cycles
- Team sets the escape hatchallow-circular-references=true
- Is there an owner and a removal date?YesCycles fixed, setting removedNoPressure disappears once it starts
- Setting copied into new servicesnew cycles grow freely
- Framework removes the hatch years latercleanup is now far larger
5 steps in order. Play them, or step through them one at a time.
3Lesson One: Read Release Notes for Default Changes
Every upgrade plan should include a step that reads the release notes and migration guide looking specifically for changed defaults, not just new features. Spring Boot publishes a migration guide for each version on its wiki, and its notes call out default changes and deprecated properties clearly. A platform team can do this once for the whole company and publish a short summary: what changes, how to detect it, how to fix it and which escape hatch exists.
Tooling helps. The spring-boot-properties-migrator module reports renamed or removed properties at startup when it is on the classpath, and automated refactoring tools such as OpenRewrite recipes can apply many mechanical changes. But a default change like circular references cannot be fixed by a tool, because the fix is a design change. That is exactly why it needs a human plan.
4Lesson Two: Track Escape Hatches Across the Fleet
With hundreds of services, nobody can remember which ones set which hatch. So we need an inventory. The cheapest version is a script in CI, or a scheduled job across all repositories, that searches configuration for known escape hatch properties and publishes a report.
Notice the last column. The report is useful only if someone acts on it, so each hatch gets an owner and a deadline, often tied to the next major upgrade, after which the platform's shared configuration stops allowing it. Teams can request an exception with a reason, and the exception is visible in the report. This turns the vague 'fix it later' into a tracked piece of work with a date.
5Lesson Three: Encode Decisions in Shared Starters
Many organisations publish their own Spring Boot starter, a library each service depends on that brings the company's standard configuration and auto-configuration. The starter is a good place to apply decisions consistently. It can set sensible defaults, fail the build or log a loud warning when a deprecated hatch is used, and carry an upgrade together with its migration notes.
For example, after the 2.6 change, a platform starter could leave the framework default in place, add a startup check that logs a warning with a link to the internal guide whenever allow-circular-references is true, and in the next major starter version turn that warning into a failure. Teams then meet the change through one well-documented channel instead of discovering it on their own, each in a different way.
| Practice | Owner | What it prevents |
|---|---|---|
| Read notes for default changes | platform team, once per upgrade | surprises at startup across many services |
| Inventory of escape hatches | platform team, weekly job | hatches that nobody remembers |
| Owner and deadline per hatch | each service team | temporary settings that become permanent |
| Shared starter checks | platform team | every team solving the change differently |
6Follow-up questions
Should a platform team ever forbid an escape hatch outright?
Yes, eventually, but only after a period with a warning, a migration guide and a date everybody knew about. Forbidding it on day one blocks upgrades, which is worse than the debt; never forbidding it lets the debt grow forever. The warning period is where the inventory and deadlines do their work.
How do you keep hundreds of services on current versions at all?
By making upgrades small and frequent. Services that stay one minor version behind upgrade in hours; services three major versions behind need a project. A shared starter, automated dependency update pull requests and a published support window, for example 'we support the two latest Boot minor versions', keep everyone close to current.
Is there a lesson for our own internal libraries?
Yes, we should behave like good framework authors. When our starter changes a default, we announce it, give an escape hatch, put a removal date on it and track who uses it, exactly what we ask of Spring.
7Conclusion
In this answer, we used the circular references change as a lesson in managing upgrades at scale. Frameworks tighten defaults to prevent bad designs, and old code breaks. Escape hatches let teams upgrade first and fix later, but without an owner and a date they become permanent. We saw three practices that prevent this: reading release notes specifically for default changes, tracking escape hatch use across the fleet with deadlines, and using a shared starter to apply decisions consistently.
Open with
The change taught me that defaults are the framework's strongest tool for improving design, and that every tightened default breaks some old code. Spring silently resolved circular references for years, then Boot 2.6 turned that off, and teams with tangled services failed at startup.
Then, if they want more
The escape hatch, allow-circular-references, was a good idea because it separated the upgrade from the cleanup, but in a big organisation 'later' often never comes: the property gets copied into new services and new cycles grow behind it. So I now plan upgrades with three habits.
First, someone reads the migration guide specifically for default changes and publishes a short internal note on how to detect and fix each one. Second, we keep an inventory: a weekly job across all repositories lists which services use which escape hatch, each one has an owner and a deadline, usually the next major upgrade, and exceptions are visible.
Third, we use our shared starter to apply decisions the same way everywhere, for example warning at startup when a deprecated hatch is set and turning that into a failure in the next major version. And we treat our own internal libraries the same way when we change their defaults.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Spring Boot 2.6, Spring Boot 3
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Framework reference, Core technologies
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Spring Boot changed its default to reject circular references. Looking back, what does...": https://scrivio-interview-library.netlify.app/spring-boot/dependency-injection/03e55b00ec/