Skip to content

Conversation

@albertsundjaja
Copy link
Contributor

@albertsundjaja albertsundjaja commented Jul 5, 2025

This PR add cycle detection where it return error instead of waiting for stack overflow

This is a fix for #77
The root cause of the issue was the type being processed is deeply nested and has cycle. Hence, the heap memory growth is faster than the stack growth, it went OOM before stack overflow panic can kick in

@jba
Copy link
Contributor

jba commented Jul 7, 2025

Thanks. I agree, let's drop the caching and keep the cycle detection.

@albertsundjaja albertsundjaja changed the title jsonchema: add memoization and cycle detection (#77) jsonchema: add cycle detection (#77) Jul 10, 2025
}
}

func TestForWithMutation(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

context: I'm keeping this unit test, I think they are still good to have

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure.

@jba
Copy link
Contributor

jba commented Jul 10, 2025

Thanks for doing this!

@jba jba merged commit e27a36e into modelcontextprotocol:main Jul 10, 2025
3 checks passed
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.

2 participants