anton-vinogradov commented on PR #13440:
URL: https://github.com/apache/ignite/pull/13440#issuecomment-5239537904

   > There are some messages, that have `GridDeploymentInfoMessage` field, but 
doesn't implement `DeploymentAware`:
   > - `GridJobExecuteRequest`
   > - `GridIoUserMessage`
   > - `GridCacheMessage`
   > - `DataStreamerRequest`
   >
   > Is it planned, that these messages (or any other) become `DeploymentAware` 
in the future?
   
   Thanks for the review. The answer turned out to be no, and `DeploymentAware` 
is gone from this PR entirely - it was removed a few hours before your review, 
so you were looking at the earlier version.
   
   It let a message declare "my classes come with this deployment", and the 
generated marshaller resolved the class loader from it. @petrov-mg asked why 
`depInfo.classLoaderId().globalId()` was used as the sender node, and digging 
into that showed the interface was promising something a message cannot deliver.
   
   Resolving a deployment needs the **sending** node, and it is not the owner 
of the class loader in general:
   
   ```java
   assert sndId.equals(ldrId.globalId()) || participants != null;   // 
GridCacheDeploymentManager
   ```
   
   A node that received classes by peer loading passes them on as a participant 
of the same deployment - `GridDeploymentManager#deploy` hands it the deployment 
of the original owner, which the comment there calls a nested execution. The 
receiving side then asks the sender for the classes, records it with 
`addParticipant`, and drops the deployment when that node has left. Deriving it 
from the loader id breaks exactly the case participants exist for.
   
   Generated code cannot supply the sender - `unmarshal` only gets a 
`GridKernalContext` - so the interface had no way to be correct. It is deleted, 
together with the resolution in the generator and its test; `modules/codegen` 
is no longer part of this PR.
   
   What all these messages do share is the descriptor itself: they carry 
`GridDeploymentInfoMessage` instead of four flat fields, and each receiver 
makes one call - `globalDeployment(depInfo, clsName, sndNodeId)` - instead of 
assembling the deployment by hand. That was the point of the ticket, and it 
holds without the marker interface.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to