@@ -118,7 +118,7 @@ public Response renewLease(
118118 }
119119 // Check if we need to sync based on dirty time stamp, the client
120120 // instance might have changed some value
121- Response response = null ;
121+ Response response ;
122122 if (lastDirtyTimestamp != null && serverConfig .shouldSyncWhenTimestampDiffers ()) {
123123 response = this .validateDirtyTimestamp (Long .valueOf (lastDirtyTimestamp ), isFromReplicaNode );
124124 // Store the overridden status since the validation found out the node that replicates wins
@@ -239,15 +239,15 @@ public Response updateMetadata(@Context UriInfo uriInfo) {
239239 InstanceInfo instanceInfo = registry .getInstanceByAppAndId (app .getName (), id );
240240 // ReplicationInstance information is not found, generate an error
241241 if (instanceInfo == null ) {
242- logger .error ("Cannot find instance while updating metadata for instance {}" , id );
243- return Response .serverError ( ).build ();
242+ logger .warn ("Cannot find instance while updating metadata for instance {}/{}" , app . getName () , id );
243+ return Response .status ( Status . NOT_FOUND ).build ();
244244 }
245245 MultivaluedMap <String , String > queryParams = uriInfo .getQueryParameters ();
246246 Set <Entry <String , List <String >>> entrySet = queryParams .entrySet ();
247247 Map <String , String > metadataMap = instanceInfo .getMetadata ();
248248 // Metadata map is empty - create a new map
249249 if (Collections .emptyMap ().getClass ().equals (metadataMap .getClass ())) {
250- metadataMap = new ConcurrentHashMap <String , String >();
250+ metadataMap = new ConcurrentHashMap <>();
251251 InstanceInfo .Builder builder = new InstanceInfo .Builder (instanceInfo );
252252 builder .setMetadata (metadataMap );
253253 instanceInfo = builder .build ();
0 commit comments