Giter VIP home page Giter VIP logo

cl-aws-lambda's People

Contributors

fisxoj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cl-aws-lambda's Issues

Syscall poll(2) failed

Not entirely sure what causes this. Seemed like it got better when I added the chdir call to set the directory to the lambda runtime dir. This issue is to track the problem and collect data.

It seems to only happen intermittently.

Update 5-3-2019:
I believe this is related to the lambda runtime 'freezing' the process and 'thawing' it out. Some state is lost and it seems like usocket chokes on a file descriptor that isn't available anymore (or something like that, note the reference to file descriptor 3 in the backtrace below).

A cloudwatch log of the problem:

START RequestId: bb3f8e16-f7d9-4060-a1fb-e8ba316aa2e0 Version: $LATEST
Unhandled DEXADOR.ERROR:HTTP-REQUEST-FORBIDDEN in thread #<SB-THREAD:THREAD "main thread" RUNNING
{10005905B3}>:
An HTTP request to "http://127.0.0.1:9001/2018-06-01/runtime/init/error" returned 403 forbidden.
{
    "errorMessage": "Transition from STATE_INVOKE_NEXT to STATE_INIT_ERROR is not allowed.",
    "errorType": "InvalidStateTransition"
}


Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10005905B3}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<DEXADOR.ERROR:HTTP-REQUEST-FORBIDDEN {1003550CA3}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<DEXADOR.ERROR:HTTP-REQUEST-FORBIDDEN {1003550CA3}>)
2: (INVOKE-DEBUGGER #<DEXADOR.ERROR:HTTP-REQUEST-FORBIDDEN {1003550CA3}>)
3: (UIOP/IMAGE:HANDLE-FATAL-CONDITION #<DEXADOR.ERROR:HTTP-REQUEST-FORBIDDEN {1003550CA3}>)
4: (SB-KERNEL::%SIGNAL #<DEXADOR.ERROR:HTTP-REQUEST-FORBIDDEN {1003550CA3}>)
5: (ERROR DEXADOR.ERROR:HTTP-REQUEST-FORBIDDEN :BODY "{\"errorMessage\":\"Transition from STATE_INVOKE_NEXT to STATE_INIT_ERROR is not allowed.\",\"errorType\":\"InvalidStateTransition\"}
" :STATUS 403 :HEADERS #<HASH-TABLE :TEST EQUAL :COUNT 3 {1003430A73}> :URI #<QURI.URI.HTTP:URI-HTTP http://127.0.0.1:9001/2018-06-01/runtime/init/error> :METHOD :POST)
6: (DEXADOR.ERROR:HTTP-REQUEST-FAILED 403 :BODY "{\"errorMessage\":\"Transition from STATE_INVOKE_NEXT to STATE_INIT_ERROR is not allowed.\",\"errorType\":\"InvalidStateTransition\"}
" :HEADERS #<HASH-TABLE :TEST EQUAL :COUNT 3 {1003430A73}> :URI #<QURI.URI.HTTP:URI-HTTP http://127.0.0.1:9001/2018-06-01/runtime/init/error> :METHOD :POST)
7: (DEXADOR.BACKEND.USOCKET:REQUEST #<unavailable argument> :METHOD :POST :CONTENT "{\"errorMessage\":\"Uncaught error signaled during initialization:\\n Syscall poll(2) failed: Operation not permitted\\n\\n\",\"errorType\":\"UNCAUGHT-ERROR\"}")
8: ((FLET "H1" :IN CL-AWS-LAMBDA/RUNTIME:MAIN) #<SIMPLE-ERROR "Syscall poll(2) failed: ~A" {10031A1D83}>)
9: (SB-KERNEL::%SIGNAL #<SIMPLE-ERROR "Syscall poll(2) failed: ~A" {10031A1D83}>)
10: (ERROR "Syscall poll(2) failed: ~A" "Operation not permitted")
11: (SB-UNIX:UNIX-SIMPLE-POLL 3 :INPUT -1)
12: (SB-SYS:WAIT-UNTIL-FD-USABLE 3 :INPUT NIL NIL)
13: (SB-IMPL::REFILL-INPUT-BUFFER #<SB-SYS:FD-STREAM for "socket 127.0.0.1:37728, peer: 127.0.0.1:9001" {100319BCC3}>)
14: (SB-IMPL::INPUT-UNSIGNED-8BIT-BYTE #<SB-SYS:FD-STREAM for "socket 127.0.0.1:37728, peer: 127.0.0.1:9001" {100319BCC3}> NIL NIL)
15: (READ-BYTE #<SB-SYS:FD-STREAM for "socket 127.0.0.1:37728, peer: 127.0.0.1:9001" {100319BCC3}> NIL NIL)
16: (DEXADOR.BACKEND.USOCKET::READ-UNTIL-CRLF*2 #<SB-SYS:FD-STREAM for "socket 127.0.0.1:37728, peer: 127.0.0.1:9001" {100319BCC3}>)
17: (DEXADOR.BACKEND.USOCKET::READ-RESPONSE #<SB-SYS:FD-STREAM for "socket 127.0.0.1:37728, peer: 127.0.0.1:9001" {100319BCC3}> T NIL T)
18: (DEXADOR.BACKEND.USOCKET:REQUEST #<unavailable argument> :METHOD :GET)
19: (CL-AWS-LAMBDA/RUNTIME-INTERFACE:NEXT-INVOCATION)
20: (CL-AWS-LAMBDA/RUNTIME:MAIN)
21: ((LAMBDA NIL :IN UIOP/IMAGE:RESTORE-IMAGE))
22: (UIOP/IMAGE:CALL-WITH-FATAL-CONDITION-HANDLER #<CLOSURE (LAMBDA NIL :IN UIOP/IMAGE:RESTORE-IMAGE) {1002DBFA6B}>)
23: ((FLET SB-UNIX::BODY :IN SAVE-LISP-AND-DIE))
24: ((FLET "WITHOUT-INTERRUPTS-BODY-7" :IN SAVE-LISP-AND-DIE))
25: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))

unhandled condition in --disable-debugger mode, quitting
END RequestId: bb3f8e16-f7d9-4060-a1fb-e8ba316aa2e0
REPORT RequestId: bb3f8e16-f7d9-4060-a1fb-e8ba316aa2e0 Init Duration: 341.04 ms Duration: 1313.80 ms Billed Duration: 1700 ms Memory Size: 128 MB Max Memory Used: 104 MB 

Tests

  • Unit(ish) tests
    • Handling different responses from handler function
    • Errors during invocation
  • Integration tests
    • Maybe a few using lambci docker images
    • Simulate the runtime and pass a few calls/errors

Better error handling

It would be nice to have an idiomatic way of allowing errors to bubble up to the runtime. Probably worth researching a bit how others handle this.

eg.

  • Returning error statuses for HTTP requests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.