Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursively defined Avro records trigger stack overflow #328

Open
afhole opened this issue Jun 22, 2022 · 0 comments
Open

Recursively defined Avro records trigger stack overflow #328

afhole opened this issue Jun 22, 2022 · 0 comments

Comments

@afhole
Copy link

afhole commented Jun 22, 2022

Avro allows records to be defined recursively. There is an example of a linked list in the Avro specification:

{
  "type": "record",
  "name": "LongList",
  "aliases": ["LinkedLongs"],                      // old name for this
  "fields" : [
    {"name": "value", "type": "long"},             // each element has a long
    {"name": "next", "type": ["null", "LongList"]} // optional next element
  ]
}

If I attempt to use a similar schema I get a stack overflow Exception: java.lang.StackOverflowError: null

I forked the repo to create a minimal reproduction of this error in the test suite:
afhole@8c86cc0

The results can be seen on CircleCI here:
https://app.circleci.com/pipelines/github/afhole/jackdaw/2/workflows/59ba5164-4489-40fe-8e49-fb9eb5b2319c/jobs/8

Is it feasible for Jackdaw to implement this feature? Are there any alternative ways to create a serdes that does support this (e.g. interop with Apache/Confluent modules)?

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

No branches or pull requests

1 participant