File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed
org-code-javabuilder/lib/src/main/java/org/code/javabuilder Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,12 @@ private void sendMessageHelper(PostToConnectionRequest post) {
44
44
this .api .postToConnection (post );
45
45
} catch (GoneException e ) {
46
46
throw new InternalFacingRuntimeException (CONNECTION_TERMINATED , e );
47
+ } catch (IllegalStateException e ) {
48
+ // Thrown when the API Gateway client has been unexpectedly shut down.
49
+ // We are still actively investigating why this happens in the first place,
50
+ // but this will make the container fail for all subsequent sessions, so it
51
+ // should be recycled.
52
+ throw new FatalError (FatalErrorKey .CONNECTION_POOL_SHUT_DOWN , e );
47
53
}
48
54
}
49
55
}
Original file line number Diff line number Diff line change 1
1
package org .code .javabuilder ;
2
2
3
- import static org .code .javabuilder .LambdaErrorCodes .LOW_DISK_SPACE_ERROR_CODE ;
4
- import static org .code .javabuilder .LambdaErrorCodes .TEMP_DIRECTORY_CLEANUP_ERROR_CODE ;
3
+ import static org .code .javabuilder .LambdaErrorCodes .*;
5
4
6
5
public enum FatalErrorKey {
7
6
LOW_DISK_SPACE (LOW_DISK_SPACE_ERROR_CODE ),
8
- TEMP_DIRECTORY_CLEANUP_ERROR (TEMP_DIRECTORY_CLEANUP_ERROR_CODE );
7
+ TEMP_DIRECTORY_CLEANUP_ERROR (TEMP_DIRECTORY_CLEANUP_ERROR_CODE ),
8
+ CONNECTION_POOL_SHUT_DOWN (CONNECTION_POOL_SHUT_DOWN_ERROR_CODE );
9
9
10
10
private final int errorCode ;
11
11
Original file line number Diff line number Diff line change @@ -8,4 +8,5 @@ private LambdaErrorCodes() {
8
8
public static final int TEMP_DIRECTORY_CLEANUP_ERROR_CODE = 10 ;
9
9
public static final int LOW_DISK_SPACE_ERROR_CODE = 50 ;
10
10
public static final int OUT_OF_MEMORY_ERROR_CODE = 60 ;
11
+ public static final int CONNECTION_POOL_SHUT_DOWN_ERROR_CODE = 70 ;
11
12
}
Original file line number Diff line number Diff line change 6
6
import java .util .logging .Logger ;
7
7
import org .code .javabuilder .InternalFacingRuntimeException ;
8
8
import org .code .protocol .ClientMessage ;
9
+ import org .code .protocol .JavabuilderThrowableMessageUtils ;
9
10
import org .code .protocol .OutputAdapter ;
10
11
11
12
public final class LambdaUtils {
@@ -33,7 +34,7 @@ public static void safelySendMessage(
33
34
}
34
35
} catch (Exception e ) {
35
36
// Catch any other exceptions here to prevent them from propagating.
36
- Logger .getLogger (MAIN_LOGGER ).warning (e . getMessage ( ));
37
+ Logger .getLogger (MAIN_LOGGER ).warning (JavabuilderThrowableMessageUtils . getLoggingString ( e ));
37
38
}
38
39
}
39
40
}
You can’t perform that action at this time.
0 commit comments