ontopic icon indicating copy to clipboard operation
ontopic copied to clipboard

Enhance cleanup mechanism to account for token expiry

Open whummer opened this issue 5 years ago • 1 comments

Thanks for publishing this useful library!

After staying connected for some time, the SQS polling fails with:

ExpiredToken: The security token included in the request is expired

In this case, the Node.js process dies, but is unable to perform the cleanup (because deleting the SQS queues would require a valid token).

It would be useful to have a more robust cleanup mechanism, e.g., by defining the name of the queue via the command line, or based on certain attributes attached to the test queue. ontopic could then identify and clean up old left-over SQS queues on startup.

Another option could be to allow the user to update the credentials at runtime.

whummer avatar Feb 03 '20 14:02 whummer

Good point, I will need to think about what we could realistically do. In the meantime I added some improvements in https://github.com/ziggy42/ontopic/pull/3:

  • add tag to SQS queue
  • try to remove resources after error in listen function
  • print to stdout instructions to handle failed removed resources

ziggy42 avatar Feb 03 '20 22:02 ziggy42