Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to DynamoDB stalls if response is discarded #523

Open
NickSeagull opened this issue Mar 26, 2019 · 1 comment
Open

Call to DynamoDB stalls if response is discarded #523

NickSeagull opened this issue Mar 26, 2019 · 1 comment
Milestone

Comments

@NickSeagull
Copy link

NickSeagull commented Mar 26, 2019

Looks like if the send call returns an error, and you discard the result, it will get crazy, and stall indefinitely, resulting in a Lambda timeout.

Instead of doing:

-- Amazonka imported qualified as AWS

AWS.putItem tableName
& AWS.piItem .~ dynamoItem
& AWS.send
& void

This works:

let putItem = AWS.putItem tableName
              & AWS.piItem .~ dynamoItem

response <- AWS.send putItem

let status = response ^. AWS.pirsResponseStatus
when (status /= 200) do
  print status
  error ( show $ response ^. AWS.pirsAttributes )

What I suspect that is happening here is that Haskell's laziness is doing something weird with the result, never returning from the mandatory call to AWS.runAWST.

@endgame
Copy link
Collaborator

endgame commented Sep 27, 2021

There's a workaround, so I don't want to blow out the 2.0RC too much by including this, but perhaps AWS.send should force the result if it's not already doing so?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants