You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-11Lines changed: 17 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,9 @@ their functions against potential bugs unique to AWS Lambda SnapStart environmen
7
7
8
8
Following sections explain how to enable this plugin in your Gradle and Maven projects.
9
9
10
+
|:exclamation: Maven repository may not have the artifact available by the time you're reading these instructions. Until it's available, you can clone this repository to your local and run `mvn install` to install this SpotBugs plugin to your local Maven repository. After that you can continue with the setup instructions below.|
11
+
|-----------------------------------------|
12
+
10
13
### Gradle Builds
11
14
12
15
After SpotBugs is [enabled in the Gradle project](https://spotbugs.readthedocs.io/en/latest/gradle.html) declaring a dependency on SnapStart bug scanner is sufficient.
After updating the `build.gradle` file you can run `./gradlew check` to run the analysis and see the result.
36
+
32
37
### Maven Builds
33
38
34
39
After SpotBugs is [enabled in the Maven project](https://spotbugs.readthedocs.io/en/latest/maven.html) declaring a dependency on SnapStart bug scanner is sufficient.
@@ -41,7 +46,7 @@ Example:
41
46
<plugin>
42
47
<groupId>com.github.spotbugs</groupId>
43
48
<artifactId>spotbugs-maven-plugin</artifactId>
44
-
<version>${spotbugs.version}</version>
49
+
<version>4.7.3.0</version>
45
50
<configuration>
46
51
<effort>Max</effort>
47
52
<threshold>medium</threshold>
@@ -59,20 +64,21 @@ Example:
59
64
</build>
60
65
```
61
66
67
+
After updating `pom.xml` you can run `mvn compile && mvn spotbugs:spotbugs` to run the analysis and see results in `targets/spotbugsXml.xml` file. Also, you can run `mvn spotbugs:check` to see results on your terminal and `mvn spotbugs:gui` on SpotBug's graphical UI.
68
+
62
69
## Bug Descriptions
63
70
64
71
### SNAP_START: Detected handler state that is potentially not resilient to VM snapshot and restore operations. (AWS_LAMBDA_SNAP_START_BUG)
65
72
66
-
Our analysis shows that AWS Lambda handler class initialization creates state that might have adverse effects
67
-
on the output of the function when it uses SnapStart. Lambda functions that use SnapStart are
68
-
snapshotted at their initialized state and all execution environments created afterwards share the same initial
69
-
state. This means that if the Lambda function relies on state that is not resilient to snapshot and restore
70
-
operations, it might manifest an unexpected behavior by using SnapStart.
73
+
Our analysis shows that AWS Lambda handler class initialization creates state that may not remain unique for the function
74
+
when it uses SnapStart. Lambda functions that use SnapStart are snapshotted at their initialized state and all execution
75
+
environments created afterwards share the same initial state. This means that if the Lambda function relies on state that
76
+
is not resilient to snapshot and restore operations, it might manifest an unexpected behavior by using SnapStart.
71
77
72
78
Note that there are countless ways of initializing a Lambda function handler such that it’s not compatible
73
-
with SnapStart. This tool helps you as much as possible but please use your own judgement to and refer
74
-
to [the documentation](https://github.com/aws/aws-lambda-snapstart-java-rules/wiki) for
75
-
understanding how to avoid making your Lambda function SnapStart incompatible.
79
+
with SnapStart. This tool helps provide an insight on possible cases where your code may not be fully compatible with
80
+
snapstart enabled. Please verify that your code maintains uniqueness with SnapStart. For best practices, follow the
81
+
guidelines outlined in the SnapStart [documentation](https://github.com/aws/aws-lambda-snapstart-java-rules/wiki).
0 commit comments