Does SQS kill long running jobs that have Thread.sleep?

+1 vote

I have some java code that calls Thread.sleep(100_000) inside a job running in SQS. In production, during the sleep the job is often killed and re-submitted as failed. On dev I can never re-create that. Does SQS in production kill long running jobs?

Aug 23, 2018 in AWS by bug_seeker
• 15,350 points
21 views

1 answer to this question.

0 votes

SQS doesn't kill jobs - and I am not sure what you mean by you have code 'running in SQS' - what SQS does do, is to assume your job (which is running someplace other than SQS), has failed if you don't mark it completed within the timeout (Default Visibility Timeout) you set when you setup the queue.

Your job asks SQS for an item to work on (a message to process) - your job is supposed to do that work and then tell SQS that the job is now done (deletemessage). If you don't tell it it is done, SQS makes an assumption for you that the job has failed and puts the message back in the queue for another task to process.

If you need more time to complete the tasks, you can change the default visibility timeout to a higher value if you want.

answered Aug 23, 2018 by Priyaj
• 56,520 points

Related Questions In AWS

0 votes
1 answer

Does one have to be a machine learning expert to use Amazon Lex?

No machine learning expertise is necessary to ...READ MORE

answered Nov 8, 2018 in AWS by Archana
• 5,560 points
35 views
0 votes
1 answer

To receive internet traffic why does Internet Gatway have to be added to Route Tables

When you create a subnet,It will be ...READ MORE

answered Nov 13, 2018 in AWS by Priyaj
• 56,520 points
35 views
0 votes
1 answer
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
147 views
0 votes
1 answer
0 votes
1 answer

AWS is 99.999% durable what does that mean?

you can look into this hope this ...READ MORE

answered Jul 9, 2018 in AWS by Priyaj
• 56,520 points
76 views
0 votes
1 answer