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

[BUG] Unbounded execution for write threads when parsing a flat_object field provided as array #15982

Closed
mgodwan opened this issue Sep 18, 2024 · 1 comment · Fixed by #15985
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing untriaged

Comments

@mgodwan
Copy link
Member

mgodwan commented Sep 18, 2024

Describe the bug

Unbounded execution for write threads when parsing a flat_object field provided as array.
Ideally, this should error out gracefully.

Related component

Indexing

To Reproduce

PUT dummy
{
    "mappings": {
        "properties": {
            "ArrField": {
                "type": "flat_object"
            }
        }
    }
}

# Succeeds
POST dummy/_doc
{
    "ArrField": {
        "ObjKey": "ObjVal"
    }
}

# Stuck forever
POST dummy/_doc
{
    "ArrField": ["ArrVal"]
}

Expected behavior

Error out due to lack of support.

Additional Details

Plugins
none

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: Mac
  • Version: Sonoma

Additional context
Add any other context about the problem here.

@mgodwan mgodwan added bug Something isn't working untriaged labels Sep 18, 2024
@github-actions github-actions bot added the Indexing Indexing, Bulk Indexing and anything related to indexing label Sep 18, 2024
@msfroh
Copy link
Collaborator

msfroh commented Sep 18, 2024

I just found this:

    public XContentParser parseObject() throws IOException {
        assert currentToken() == Token.START_OBJECT;
        parser.nextToken(); // Skip the outer START_OBJECT. Need to return on END_OBJECT.

        builder.startObject();

That assert is useless in production if we're not guarding this entry-point. I'll add the appropriate check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing untriaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants