Conversation
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
🔴 Playwright Results — 2 failure(s), 20 flaky✅ 3331 passed · ❌ 2 failed · 🟡 20 flaky · ⏭️ 183 skipped
Genuine Failures (failed on all attempts)❌
|
| protected Authorizer authorizer; | ||
| private AuthenticatorHandler authenticatorHandler; | ||
| protected Limits limits; | ||
| private volatile boolean mcpServerRegistered = false; |
There was a problem hiding this comment.
💡 Edge Case: Non-atomic check-then-act on mcpServerRegistered flag
The volatile boolean mcpServerRegistered guard uses a read-then-write pattern without synchronization. While both current call sites (Dropwizard run() and TestSuiteBootstrap) execute sequentially, this pattern is fragile — if a future caller invokes registerMCPServer concurrently, both threads could pass the if (mcpServerRegistered) check before either sets it to true, causing double registration.
Using AtomicBoolean.compareAndSet() makes the intent self-documenting and safe against future concurrent callers.
Suggested fix:
// Field declaration
private final AtomicBoolean mcpServerRegistered = new AtomicBoolean(false);
// Guard in registerMCPServer
protected void registerMCPServer(...) {
if (!mcpServerRegistered.compareAndSet(false, true)) {
LOG.info("MCP Server already registered, skipping");
return;
}
try {
// ... existing logic, but reset on failure:
} catch (Exception ex) {
mcpServerRegistered.set(false);
// handle error
}
}
Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion
Code Review 👍 Approved with suggestions 0 resolved / 1 findingsUpgrades MCP SDK to 1.1.0 and resolves Jackson 2/3 conflicts and duplicate servlet registration. Consider adding synchronization around the mcpServerRegistered flag check-then-act pattern to prevent potential race conditions. 💡 Edge Case: Non-atomic check-then-act on mcpServerRegistered flag📄 openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplication.java:208 📄 openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplication.java:407 The Using Suggested fix🤖 Prompt for agentsOptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
|
playwright failures known and fixed, merging |
|
Changes have been cherry-picked to the 1.12.2 branch. |
* Fix: Upgrade MCP SDK to 1.1.0 to resolve elicitation deserialization crash * Fix Jackson 2/3 conflict and duplicate MCP servlet registration --------- Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> (cherry picked from commit 6c001cb)



Describe your changes:
Fixes #26454
I worked on ... because ...
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>Summary by Gitar
pom.xmljacksontojackson2inMcpServer.javaandMcpUtils.javamcptomcp-coreand addedmcp-json-jackson2dependencyOpenMetadataApplication.javamcpdependency fromopenmetadata-service/pom.xmlThis will update automatically on new commits.