serverless-dynamodb-local icon indicating copy to clipboard operation
serverless-dynamodb-local copied to clipboard

Serverless eventually locks up when running for a while

Open robpc opened this issue 6 years ago • 3 comments
trafficstars

Actual Behaviour Launching serverless-offline with serverless-dynamodb-local will always lock up after some seemingly random period of time. The terminal becomes unresponsive and there is no error or crash report.

Expected Behaviour

Run indefinitely.

Steps to reproduce it

I created a repo with a minimal project that has this behavior. https://github.com/robpc/dynamodb-local-test

If you follow the instructions in the example repo above and run the test script, the api will eventually will become unresponsive. Sometime it's been as early as 21 seconds in and sometimes it's as late as 10 minutes in. There appear to be periods of long delays (30-60 seconds) leading up to this point, but eventually it will be locked up and control-c has no effect. In my experience, it locks up the OS so badly a restart is required.

LogCat for the issue No actual logs are shown, the process and serverless api lock up and are unresponsive.

Example output from the test linked above:

23:51 ✔ $ ./test.sh

Setup -- {"id":"1234","date":"4/11/2019, 10:52:18 PM"}

Press Q to exit.

  0 Days, 00:00:21 -- #47 -- {"date":"4/11/2019, 10:52:18 PM","id":"1234"}

Example serverless-offline output from the project above

23:43 ✔ $ npm run start

> [email protected] start /mnt/c/Users/Admin/projects/dunlin/dynamodb-test
> serverless offline start --migrate

Dynamodb Local Started, Visit: http://localhost:8000/shell
Serverless: DynamoDB - created table robpc-dynamodb-test-dev
Serverless: Starting Offline: dev/us-east-1.

Serverless: Routes for read:
Serverless: GET /api/test/{id}

Serverless: Routes for write:
Serverless: POST /api/test/{id}

Serverless: Offline listening on http://localhost:3000

Serverless: POST /api/test/1234 (λ: write)

Serverless: GET /api/test/1234 (λ: read)

Serverless: GET /api/test/1234 (λ: read)

Serverless: GET /api/test/1234 (λ: read)

Serverless: GET /api/test/1234 (λ: read)

Serverless: GET /api/test/1234 (λ: read)

...

robpc avatar Apr 12 '19 04:04 robpc

Follow up with some things I tried after posting this issue:

  1. I commented out the calls to dynamodb and was able to run the test for 6+hours, so that ruled out serverless in general.
  2. I saw the DynamodbLocal.jar was running Oracle JDK 8 so I switched to that and still saw the issue.

robpc avatar Apr 17 '19 02:04 robpc

Being suspicious of my own code I also updated the test code to remove some helpers I pulled from another project, but still had the issue.

robpc avatar Apr 17 '19 03:04 robpc

Can confirm I'm also having this issue. The time it takes until it freezes appears to be getting progressively worse for me each time.

tim-stasse avatar Apr 30 '19 07:04 tim-stasse