Bug - Worker crashes when connecting while the core has a job waiting
Description
14:32:39.665 [Thread-1] INFO nl.tudelft.ewi.auta.worker.conn.ServerConnector - Successfully connected!
14:32:39.676 [Thread-1] DEBUG nl.tudelft.ewi.auta.worker.control.ControlProcessor - Acting on control message ping
14:32:39.744 [Thread-1] DEBUG nl.tudelft.ewi.auta.worker.control.ControlProcessor - Acting on control message alice
14:32:39.744 [Thread-1] DEBUG nl.tudelft.ewi.auta.worker.control.ControlProcessor - Received public key
14:32:39.766 [Thread-1] DEBUG nl.tudelft.ewi.auta.worker.control.ControlProcessor - Sending secret key
14:32:39.774 [Thread-1] ERROR nl.tudelft.ewi.auta.common.threads.Threads - Unhandled exception
java.lang.ClassCastException: class com.google.gson.JsonPrimitive cannot be cast to class com.google.gson.JsonObject (com.google.gson.JsonPrimitive and com.google.gson.JsonObject are in unnamed module of loader 'app')
at nl.tudelft.ewi.auta.common.jump.GsonMessageAdapter.deserialize(GsonMessageAdapter.java:61)
at nl.tudelft.ewi.auta.common.jump.GsonMessageAdapter.deserialize(GsonMessageAdapter.java:15)
at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
at com.google.gson.Gson.fromJson(Gson.java:927)
at com.google.gson.Gson.fromJson(Gson.java:892)
at com.google.gson.Gson.fromJson(Gson.java:841)
at com.google.gson.Gson.fromJson(Gson.java:813)
at nl.tudelft.ewi.auta.common.jump.Jump.read(Jump.java:244)
at nl.tudelft.ewi.auta.worker.conn.MessageRelay.listen(MessageRelay.java:181)
at nl.tudelft.ewi.auta.worker.conn.MessageRelay.run(MessageRelay.java:120)
at nl.tudelft.ewi.auta.common.threads.Threads.lambda$wrap$0(Threads.java:219)
at java.base/java.lang.Thread.run(Thread.java:834)
Exception in thread "Thread-1" nl.tudelft.ewi.auta.common.threads.CheckedExceptionTunnel: java.lang.ClassCastException: class com.google.gson.JsonPrimitive cannot be cast to class com.google.gson.JsonObject (com.google.gson.JsonPrimitive and com.google.gson.JsonObject are in unnamed module of loader 'app')
at nl.tudelft.ewi.auta.common.threads.Threads.lambda$wrap$0(Threads.java:222)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassCastException: class com.google.gson.JsonPrimitive cannot be cast to class com.google.gson.JsonObject (com.google.gson.JsonPrimitive and com.google.gson.JsonObject are in unnamed module of loader 'app')
at nl.tudelft.ewi.auta.common.jump.GsonMessageAdapter.deserialize(GsonMessageAdapter.java:61)
at nl.tudelft.ewi.auta.common.jump.GsonMessageAdapter.deserialize(GsonMessageAdapter.java:15)
at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
at com.google.gson.Gson.fromJson(Gson.java:927)
at com.google.gson.Gson.fromJson(Gson.java:892)
at com.google.gson.Gson.fromJson(Gson.java:841)
at com.google.gson.Gson.fromJson(Gson.java:813)
at nl.tudelft.ewi.auta.common.jump.Jump.read(Jump.java:244)
at nl.tudelft.ewi.auta.worker.conn.MessageRelay.listen(MessageRelay.java:181)
at nl.tudelft.ewi.auta.worker.conn.MessageRelay.run(MessageRelay.java:120)
at nl.tudelft.ewi.auta.common.threads.Threads.lambda$wrap$0(Threads.java:219)
... 1 more
^C⏎
Priority
High - this negatively impacts adding new workers dynamically while the system is under heavy load
Definition of done
When the crash no longer happens. Either by fixing the readiness of workers or by allowing the core to rerun failed jobs.