[GRADLE-2131] Exception with "Discarding connection." message Created: 28/Feb/12 Updated: 10/Feb/17 Resolved: 10/Feb/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 13 |
Description |
Today our build started to throw strange exceptions during gradle build (this one never happened before). If I run build with debug messaging turned on I see lots of following messages: TRACE - 28 Feb 02012 12:48:44.348 - Outgoing Connection [3443153e-30fc-4a50-b9c4-f430632aa45c port:53113, addresses:[/0:0:0:0:0:0:0:1%1, /127.0.0.1]]:0 worker - org.hibernate.type.descriptor.sql.BasicBinder | binding parameter [1] as [BOOLEAN] - true to parameter: 3 Which eventually leads to following exception: Could not receive message from connection. Discarding connection. Anyone ever happend to have the same issue ? |
Comments |
Comment by Gradle Forums [ 28/Feb/12 ] |
It looks like a test is throwing a `java.sql.BatchUpdateException`, and the test JVM fails to inform the Gradle JVM of that event (tests run in a separate JVM). This looks like a Gradle bug. Until this gets fixed, your best chance is to prevent tests from throwing that particular exception, for example by wrapping affected tests in a try-catch and throwing a RuntimeException instead. You can copy over message and stack trace, but do not chain the original exception. |
Comment by Kallin Nagelberg [ 21/Mar/12 ] |
I'm having the same issue13:02:29.643 [ERROR] [org.gradle.messaging.remote.internal.MessageHub$EndOfStreamConnection] Could not receive message from connection. Discarding connection. Let me know if you need help replicating. |
Comment by Kallin Nagelberg [ 21/Mar/12 ] |
I think the relevant bit is: cannot assign instance of org.gradle.messaging.remote.internal.PlaceholderException to field java.sql.SQLException.next of type java.sql.SQLException in instance of java.sql.BatchUpdateException The PlaceHolderException is used when an exception cannot be serialized or deserialized. In this case an instance of BatchUpdateException is attempting to be deserialized, which is a subclass of SqlException. SqlException has a volatile field called 'next' which is also of type SqlException. It appears the messaging framework in Gradle did not want to serialize the volatile field, so instead used a PlaceHolderException, but it left the type of the 'next' field as SqlException when it is in fact now 'PlaceHolderException'. I'll keep digging.. |
Comment by Merlyn Albery-Speyer [ 20/May/13 ] |
I've seen this same exception cause using Gradle 1.6: 10:11:06.839 [ERROR] [org.gradle.messaging.remote.internal.hub.MessageHubBackedServer] Unexpected exception thrown. |
Comment by Merlyn Albery-Speyer [ 28/May/13 ] |
Does anyone have a work-around for this issue? |
Comment by Kallin Nagelberg [ 28/May/13 ] |
I never found a workaround unfortunately. At one point I attempted to produce a failing test in the gradle source code to identify the bug but didn't get too far. If you can't workaround it that's probably your best bet at identifying the root issue and potentially producing a solution. |
Comment by Merlyn Albery-Speyer [ 01/Aug/13 ] |
+1 for a fix for this. This is still coming up. |
Comment by Etienne Studer [ 02/Aug/13 ] |
My (unconfirmed) guess is that this happens when the exception thrown in the test case is not serializable. Just a guess... |
Comment by Kallin Nagelberg [ 02/Aug/13 ] |
It's been awhile, but as I recall the issue had something to do with one of the 'next' chained exceptions not being serialized correctly.. Like it's transformed from its original class to something else (by Gradle) before being transported, but the other side doesn't know this, so when it tries to unserialize the 'next' field it is looking at an object of the wrong type. Wish I could be less vague! |
Comment by Benjamin Muschko [ 15/Nov/16 ] |
As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:
We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle! |
Comment by Benjamin Muschko [ 10/Feb/17 ] |
Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved. |