I have a python lambda code which iterates over a loop and starts 17 instances of a reusable glue job by passing run time arguments. I am using boto3 function which is start_job_run() to start the job. Below is the snippet:
job_keys = {}
for job_key_name in jobs:
try:
job_keys[job_key_name] = glue_client.start_job_run(JobName = glueJobName, Arguments = {'--Path': CONFIG_PATH, '--JobKeyName': job_key_name}) <--- Error is happening here
logger.info(f'## STARTED GLUE JOB: {glueJobName}-{job_key_name}')
logger.info(f'## GLUE JOB RUN ID: {job_keys[job_key_name]["JobRunId"]}')
logger.info(f'## SOURCE: {source}')
except Exception as e:
logger.error('ERROR DETAILS', e)
logger.error(job_key_name)
pass
The code runs fine and starts 17 executions of the glue job. But there are few intermittent instances when the lambda fails with the error not all arguments converted during string formatting. When this happens the particular job instance does not start.
Note: The max concurrency of the glue job is set to 17 and no. of workers is 2.