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

Submit hangs indefinitely if there are validation errors #109

Closed
juvester opened this issue Jun 30, 2016 · 2 comments
Closed

Submit hangs indefinitely if there are validation errors #109

juvester opened this issue Jun 30, 2016 · 2 comments

Comments

@juvester
Copy link

juvester commented Jun 30, 2016

SubmissionResultParser fails to parse the submissionStatus JSON if there are validation errors. This seems to cause an infinite loop in Submit.call() method where it just fetches the same JSON string over and over again. No interrupt exception is ever thrown, we let it run for 30+ mins.

Here's the parse exception and the JSON string causing it. The same exception is thrown like every two seconds. Very easy to reproduce, just have incorrect indentation in some exercise that does checkstyle validations and do TmcCore.submit(). Local validation works fine.

@Salmela got the parsing to work by defining ValidationResultImpl.validationErrors map as 'transient' but wasn't quite sure whether that's the right way to fix it or if it causes problems elsewhere.

Hope this helps!

@cxcorp
Copy link
Contributor

cxcorp commented Nov 28, 2016

Can confirm.

Snippet from response JSON:

"validations": {
  "strategy": "FAIL",
  "validationErrors": {
    "Main.java": [
    {
      "column": 0,
      "line": 13,
      "message": "'if' construct must use curly braces '{}'.",
      "sourceName": "com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck"
    }
    ]
  }
}

Here the parsing fails at the start of "Main.java".

The problem is that class ValidationResultImpl keeps validation errors in a Map<File, List<ValidationError>>, however, File does not get serialized into just a string containing the filename. It gets serialized into (and deserialized from) an object like such:

{"path":"Main.java"}

@nygrenh
Copy link
Member

nygrenh commented Dec 1, 2016

Fixed by #116

@nygrenh nygrenh closed this as completed Dec 1, 2016
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

3 participants