Skip to content

Commit 223a26f

Browse files
authored
docs: Update README (aws#6)
Clarifying setup instructions.
1 parent 1458864 commit 223a26f

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ their functions against potential bugs unique to AWS Lambda SnapStart environmen
77

88
Following sections explain how to enable this plugin in your Gradle and Maven projects.
99

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+
1013
### Gradle Builds
1114

1215
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.
@@ -15,7 +18,7 @@ Example:
1518

1619
```kotlin
1720
plugins {
18-
id("com.github.spotbugs") version "4.7.1"
21+
id("com.github.spotbugs") version "4.7.3"
1922
}
2023

2124
spotbugs {
@@ -24,11 +27,13 @@ spotbugs {
2427
}
2528

2629
dependencies {
27-
spotbugs("com.github.spotbugs:spotbugs:4.7.1")
30+
spotbugs("com.github.spotbugs:spotbugs:4.7.3")
2831
spotbugsPlugins("software.amazon.lambda.snapstart:aws-lambda-snapstart-java-rules:0.1")
2932
}
3033
```
3134

35+
After updating the `build.gradle` file you can run `./gradlew check` to run the analysis and see the result.
36+
3237
### Maven Builds
3338

3439
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:
4146
<plugin>
4247
<groupId>com.github.spotbugs</groupId>
4348
<artifactId>spotbugs-maven-plugin</artifactId>
44-
<version>${spotbugs.version}</version>
49+
<version>4.7.3.0</version>
4550
<configuration>
4651
<effort>Max</effort>
4752
<threshold>medium</threshold>
@@ -59,20 +64,21 @@ Example:
5964
</build>
6065
```
6166

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+
6269
## Bug Descriptions
6370

6471
### SNAP_START: Detected handler state that is potentially not resilient to VM snapshot and restore operations. (AWS_LAMBDA_SNAP_START_BUG)
6572

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.
7177

7278
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).
7682

7783
## Security
7884

src/main/resources/findbugs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<SplitPass>
88
<!--
99
We add this constraint to force running BuildRandomReturningMethodsDatabase in the
10-
second pass which follows the topological order in classes and
10+
second pass which follows the topological order in classes
1111
-->
1212
<Earlier class="edu.umd.cs.findbugs.detect.CalledMethods"/>
1313
<Later class="software.amazon.lambda.snapstart.BuildRandomReturningMethodsDatabase"/>

0 commit comments

Comments
 (0)