Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6bfa294
Deployment descriptor: resolve by the descriptor itself
anton-vinogradov Aug 5, 2026
4814601
Deployment descriptor: carry it whole in the event request
anton-vinogradov Aug 5, 2026
bc30742
Deployment descriptor: carry it whole in the user message
anton-vinogradov Aug 5, 2026
6e50b15
Deployment descriptor: carry it whole in the streamer request
anton-vinogradov Aug 5, 2026
69cdb79
Deployment descriptor: carry it whole in the job request
anton-vinogradov Aug 5, 2026
2a2839e
IGNITE-28528 Resolve the deployment class loader in generated marshal…
anton-vinogradov Aug 6, 2026
1c04395
IGNITE-28528 Self-review fixes
anton-vinogradov Aug 6, 2026
9f69ae4
IGNITE-28528 Keep the node filter off the socket-reading thread
anton-vinogradov Aug 6, 2026
166f25b
IGNITE-28528 Let the discovery layer defer unmarshalling
anton-vinogradov Aug 6, 2026
ed22879
IGNITE-28528 Keep the start request in the form it arrived
anton-vinogradov Aug 6, 2026
66c9d94
IGNITE-28528 State that the start request is passed on
anton-vinogradov Aug 6, 2026
23aca18
IGNITE-28528 Drop the forwarded-message marker
anton-vinogradov Aug 6, 2026
5e87345
Merge remote-tracking branch 'origin/master' into ignite-deployment-d…
anton-vinogradov Aug 8, 2026
58a3d33
IGNITE-28528 Self-review fixes
anton-vinogradov Aug 8, 2026
4b2985b
IGNITE-28528 Indent the generated loader resolution through the gener…
anton-vinogradov Aug 8, 2026
528b04f
IGNITE-28528 Rename GridDeploymentInfoBean to GridDeploymentInfoMessage
anton-vinogradov Aug 8, 2026
556ca2d
IGNITE-28528 Resolve the deployment loader regardless of what the cal…
anton-vinogradov Aug 8, 2026
7454525
Checkstyle autofix by Ignite PR Checker (requested via PR command)
anton-vinogradov Aug 8, 2026
e77db5c
IGNITE-28528 Keep the start request off the generated marshaller
anton-vinogradov Aug 9, 2026
a5154b8
Merge remote-tracking branch 'own/ignite-deployment-descriptor' into …
anton-vinogradov Aug 9, 2026
4f87ac3
IGNITE-28528 Fix the DeploymentAware javadoc
anton-vinogradov Aug 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.jetbrains.annotations.Nullable;

import static org.apache.ignite.internal.MessageProcessor.CACHE_OBJECT_CLS;
import static org.apache.ignite.internal.MessageProcessor.DEPLOYMENT_AWARE_MESSAGE_INTERFACE;
import static org.apache.ignite.internal.MessageProcessor.IGNITE_CHECKED_EXCEPTION_CLS;
import static org.apache.ignite.internal.MessageProcessor.KEY_CACHE_OBJECT_CLS;
import static org.apache.ignite.internal.MessageProcessor.MARSHALLABLE_MESSAGE_INTERFACE;
Expand Down Expand Up @@ -96,6 +97,9 @@ public class MessageMarshallerGenerator extends MessageCompanionGenerator {
/** */
private final TypeMirror nonMarshallableType;

/** */
private final TypeMirror deploymentAwareMsgType;

/** */
private final TypeMirror selfMarshallingMsgType;

Expand Down Expand Up @@ -140,6 +144,7 @@ public class MessageMarshallerGenerator extends MessageCompanionGenerator {
msgType = type(MESSAGE_INTERFACE);
cacheObjType = type(CACHE_OBJECT_CLS);
nonMarshallableType = type(NON_MARSHALLABLE_MESSAGE_INTERFACE);
deploymentAwareMsgType = type(DEPLOYMENT_AWARE_MESSAGE_INTERFACE);
selfMarshallingMsgType = type(SELF_MARSHALLING_MESSAGE_INTERFACE);
cacheGrpIdMsgType = type(GRID_CACHE_GROUP_ID_MESSAGE_CLS);
mapType = type(Map.class.getName());
Expand Down Expand Up @@ -306,6 +311,9 @@ private void generateUnmarshalMethod(String params, List<VariableElement> fields
if (needsCtx(fields) || !wireFieldSkip.isEmpty())
appendBlock(body, List.of(ctxResolutionLine()));

if (isDeploymentAware())
appendBlock(body, List.of(deploymentResolutionLine()));

appendFields(body, fields, MarshalMode.UNMARSHAL, wireFieldSkip);

if (marshallable)
Expand Down Expand Up @@ -1039,6 +1047,20 @@ else if (isCacheGroupIdMessage(type))
return indentedLine("CacheObjectContext ctx = cacheObjCtx;");
}

/**
* Returns the line resolving the class loader of a {@code DeploymentAware} message. The deployment the message
* carries wins over whatever the caller passed: the caller cannot know the loader of classes deployed elsewhere,
* and the overloads defaulting to the local one would silently read them without peer class loading.
*/
private String deploymentResolutionLine() {
return indentedLine("clsLdr = kctx.deploy().classLoader(msg);");
}

/** @return {@code true} if the message carries the deployment of its classes. */
private boolean isDeploymentAware() {
return deploymentAwareMsgType != null && assignableFrom(type.asType(), deploymentAwareMsgType);
}

/** Returns {@code true} if any field requires {@code ctx} in generated marshal/unmarshal code. */
private boolean needsCtx(List<VariableElement> fields) {
return fields.stream().anyMatch(f -> needsCtxType(f.asType()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public class MessageProcessor extends AbstractProcessor {
/** Message that reshapes its own fields before they go on the wire. */
static final String SELF_MARSHALLING_MESSAGE_INTERFACE = "org.apache.ignite.internal.SelfMarshallingMessage";

/** Message that carries the deployment of the classes inside it. */
static final String DEPLOYMENT_AWARE_MESSAGE_INTERFACE = "org.apache.ignite.internal.DeploymentAware";

/** Marker of messages with no marshaller. */
static final String NON_MARSHALLABLE_MESSAGE_INTERFACE = "org.apache.ignite.plugin.extensions.communication.NonMarshallableMessage";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.apache.ignite.internal.managers.communication.IgniteIoTestMessage;
import org.apache.ignite.internal.managers.communication.IgniteMessageFactory;
import org.apache.ignite.internal.managers.communication.SessionChannelMessage;
import org.apache.ignite.internal.managers.deployment.GridDeploymentInfoBean;
import org.apache.ignite.internal.managers.deployment.GridDeploymentInfoMessage;
import org.apache.ignite.internal.managers.deployment.GridDeploymentRequest;
import org.apache.ignite.internal.managers.deployment.GridDeploymentResponse;
import org.apache.ignite.internal.managers.encryption.ChangeCacheEncryptionRequest;
Expand Down Expand Up @@ -686,7 +686,7 @@ public CoreMessagesProvider(Marshaller dfltMarsh, Marshaller schemaAwareMarsh) {

// [12200 - 12300]: Binary, classloading and marshalling messages.
msgIdx = 12200;
register(GridDeploymentInfoBean.class);
register(GridDeploymentInfoMessage.class);
register(GridDeploymentRequest.class);
register(GridDeploymentResponse.class);
register(MissingMappingRequestMessage.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.ignite.internal;

import org.apache.ignite.internal.managers.deployment.GridDeploymentInfo;
import org.apache.ignite.plugin.extensions.communication.Message;

/**
* Implemented by messages that carry classes deployed from another node. The deployment lets the generated marshaller
* resolve the class loader those classes are read with, the same way {@code CacheIdAware} lets it resolve the cache
* object context.
* <p>
* Resolving may have to request the deployment from its owner and block, and it fails when the classes are gone, so a
* message stating this must be unmarshalled where blocking is allowed and where the failure reaches whoever waits for
* it. A message read on a socket-reading thread promises neither: a discovery custom message, for one, is a nested
* field of its envelope, so the envelope's marshaller reads the whole tree there, and a missing class is swallowed
* with a warning. Such a message keeps its deployment as a plain field and asks {@code GridDeploymentManager} for the
* loader where it is read, as {@code StartRequestData} does.
*
* @see MarshallableMessage
*/
public interface DeploymentAware extends Message {
/** @return Deployment of the classes the message carries. */
public GridDeploymentInfo deploymentInfo();

/** @return Name of a class the deployment must be able to load. */
public String deployedClassName();
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
import org.apache.ignite.internal.managers.deployment.GridDeployment;
import org.apache.ignite.internal.managers.deployment.GridDeploymentInfo;
import org.apache.ignite.internal.managers.deployment.GridDeploymentInfoBean;
import org.apache.ignite.internal.managers.deployment.GridDeploymentInfoMessage;
import org.apache.ignite.internal.managers.deployment.P2PClassLoadingIssues;
import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
Expand Down Expand Up @@ -403,7 +403,7 @@ private boolean filterDropsEvent(Event evt) {
if (dep == null)
throw new IgniteDeploymentCheckedException("Failed to deploy event filter: " + filter);

depInfo = new GridDeploymentInfoBean(dep);
depInfo = new GridDeploymentInfoMessage(dep);

filterBytes = U.marshal(ctx.marshaller(), filter);
}
Expand All @@ -417,11 +417,7 @@ private boolean filterDropsEvent(Event evt) {

if (filterBytes != null) {
try {
GridDeployment dep = ctx.deploy().getGlobalDeployment(depInfo.deployMode(), clsName, clsName,
depInfo.userVersion(), nodeId, depInfo.classLoaderId(), depInfo.participants(), null);

if (dep == null)
throw new IgniteDeploymentCheckedException("Failed to obtain deployment for class: " + clsName);
GridDeployment dep = ctx.deploy().globalDeployment(depInfo, clsName);

filter = U.unmarshal(ctx, filterBytes, U.resolveClassLoader(dep.classLoader(), ctx.config()));

Expand Down
Loading
Loading