Skip to content

Commit 17cbb00

Browse files
committed
DS-2253: Hotfix for too large spatial filters ending up in the state check trigger
Signed-off-by: Benjamin Rögner <benjamin.roegner@here.com>
1 parent 5087111 commit 17cbb00

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

xyz-jobs/xyz-job-steps/src/main/java/com/here/xyz/jobs/steps/execution/LambdaBasedStep.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public abstract class LambdaBasedStep<T extends LambdaBasedStep> extends Step<T>
9898
@JsonView(Internal.class)
9999
protected boolean isSimulation = false; //TODO: Remove testing code
100100
private static final Logger logger = LogManager.getLogger();
101+
protected boolean inLambda;
101102

102103
@JsonView(Internal.class)
103104
private String taskToken = TASK_TOKEN_TEMPLATE; //Will be defined by the Step Function
@@ -658,6 +659,8 @@ public void handleRequest(InputStream inputStream, OutputStream outputStream, Co
658659
if (request.getStep() == null)
659660
throw new NullPointerException("Malformed step request, missing step definition.");
660661

662+
request.getStep().inLambda = true;
663+
661664
//Set the userAgent of the web clients correctly
662665
HubWebClient.userAgent = StepWebClient.userAgent = "XYZ-JobStep-" + request.getStep().getClass().getSimpleName();
663666

xyz-jobs/xyz-job-steps/src/main/java/com/here/xyz/jobs/steps/impl/transport/CopySpace.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (C) 2017-2026 HERE Europe B.V.
3+
*
34
* Licensed under the Apache License, Version 2.0 (the "License");
45
* you may not use this file except in compliance with the License.
56
* You may obtain a copy of the License at
@@ -26,14 +27,14 @@
2627

2728
import com.fasterxml.jackson.annotation.JsonView;
2829
import com.here.xyz.events.PropertiesQuery;
29-
import com.here.xyz.models.filters.SpatialFilter;
3030
import com.here.xyz.jobs.steps.execution.StepException;
3131
import com.here.xyz.jobs.steps.execution.db.Database;
3232
import com.here.xyz.jobs.steps.impl.SpaceBasedStep;
3333
import com.here.xyz.jobs.steps.inputs.InputFromOutput;
3434
import com.here.xyz.jobs.steps.outputs.CreatedVersion;
3535
import com.here.xyz.jobs.steps.resources.Load;
3636
import com.here.xyz.jobs.steps.resources.TooManyResourcesClaimed;
37+
import com.here.xyz.models.filters.SpatialFilter;
3738
import com.here.xyz.models.geojson.coordinates.WKTHelper;
3839
import com.here.xyz.models.geojson.implementation.Geometry;
3940
import com.here.xyz.models.hub.Ref;
@@ -46,7 +47,6 @@
4647
import com.here.xyz.util.db.pg.FeatureWriterQueryBuilder.FeatureWriterQueryContextBuilder;
4748
import com.here.xyz.util.service.BaseHttpServerVerticle.ValidationException;
4849
import com.here.xyz.util.web.XyzWebClient.WebClientException;
49-
5050
import java.util.ArrayList;
5151
import java.util.List;
5252
import java.util.Map;
@@ -111,6 +111,9 @@ public static int calculateCopyTimeInSeconds(long nrFeatureSource, long featureC
111111

112112

113113
public SpatialFilter getSpatialFilter() {
114+
//TODO: This is a hotfix for large spatial filters ending up in the state check trigger paylooad. Long term fix should be to only keep the Step ID in the trigger payload and fetch the step config from service when step executions starts in lambda
115+
if (inLambda)
116+
return null;
114117
return spatialFilter;
115118
}
116119

xyz-jobs/xyz-job-steps/src/main/java/com/here/xyz/jobs/steps/impl/transport/ExportSpaceToFiles.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (C) 2017-2026 HERE Europe B.V.
3+
*
34
* Licensed under the Apache License, Version 2.0 (the "License");
45
* you may not use this file except in compliance with the License.
56
* You may obtain a copy of the License at
@@ -29,7 +30,6 @@
2930
import com.fasterxml.jackson.annotation.JsonView;
3031
import com.here.xyz.events.ContextAwareEvent.SpaceContext;
3132
import com.here.xyz.events.PropertiesQuery;
32-
import com.here.xyz.models.filters.SpatialFilter;
3333
import com.here.xyz.jobs.steps.StepExecution;
3434
import com.here.xyz.jobs.steps.execution.StepException;
3535
import com.here.xyz.jobs.steps.execution.db.Database;
@@ -41,6 +41,7 @@
4141
import com.here.xyz.jobs.steps.resources.IOResource;
4242
import com.here.xyz.jobs.steps.resources.Load;
4343
import com.here.xyz.jobs.steps.resources.TooManyResourcesClaimed;
44+
import com.here.xyz.models.filters.SpatialFilter;
4445
import com.here.xyz.models.geojson.exceptions.InvalidGeometryException;
4546
import com.here.xyz.models.hub.Ref;
4647
import com.here.xyz.models.hub.Space;
@@ -53,7 +54,6 @@
5354
import com.here.xyz.util.geo.GeometryValidator;
5455
import com.here.xyz.util.service.BaseHttpServerVerticle.ValidationException;
5556
import com.here.xyz.util.web.XyzWebClient.WebClientException;
56-
5757
import java.io.IOException;
5858
import java.sql.SQLException;
5959
import java.util.ArrayList;
@@ -153,6 +153,9 @@ public ExportSpaceToFiles withStepExecutionHeartBeatTimeoutOverride(int timeOutS
153153
}
154154

155155
public SpatialFilter getSpatialFilter() {
156+
//TODO: This is a hotfix for large spatial filters ending up in the state check trigger paylooad. Long term fix should be to only keep the Step ID in the trigger payload and fetch the step config from service when step executions starts in lambda
157+
if (inLambda)
158+
return null;
156159
return spatialFilter;
157160
}
158161

0 commit comments

Comments
 (0)