[SPARK-3398] [SPARK-4325] [EC2] Use EC2 status checks.
[SPARK-3398] [SPARK-4325] [EC2] Use EC2 status checks.

This PR re-introduces [0e648bc](https://github.com/apache/spark/commit/0e648bc2bedcbeb55fce5efac04f6dbad9f063b4) from PR #2339, which somehow never made it into the codebase.

Additionally, it removes a now-unnecessary linear backoff on the SSH checks since we are blocking on EC2 status checks before testing SSH.

Author: Nicholas Chammas <nicholas.chammas@gmail.com>

Closes #3195 from nchammas/remove-ec2-ssh-backoff and squashes the following commits:

efb29e1 [Nicholas Chammas] Revert "Remove linear backoff."
ef3ca99 [Nicholas Chammas] reuse conn
adb4eaa [Nicholas Chammas] Remove linear backoff.
55caa24 [Nicholas Chammas] Check EC2 status checks before SSH.

aosagie/spark,adrian-ionescu/apache-spark,ajaysaini725/spark,ericvandenbergfb/spark,HyukjinKwon/spark,BryanCutler/spark,tejasapatil/spark,Panos-Bletsos/spark-cost-model-optimizer,liutang123/spark,cin/spark,mzl9039/spark,witgo/spark,kissmetrics/spark,mdespriee/spark,sureshthalamati/spark,setjet/spark,hvanhovell/spark,andrewor14/iolap,HyukjinKwon/spark,saturday-shi/spark,dbtsai/spark,ibm-research-ireland/sparkoscope,ptkool/spark,ericvandenbergfb/spark,Aegeaner/spark,yanboliang/spark,holdenk/spark,metamx/spark,akopich/spark,ueshin/apache-spark,ddna1021/spark,WindCanDie/spark,wzhfy/spark,mzl9039/spark,ConeyLiu/spark,gioenn/xSpark,markhamstra/spark,chuckchen/spark,rekhajoshm/spark,joseph-torres/spark,andrewor14/spark,gengliangwang/spark,JerryLead/spark,jiangxb1987/spark,sachintyagi22/spark,actuaryzhang/spark,xflin/spark,skonto/spark,andrewor14/iolap,rezasafi/spark,xuanyuanking/spark,tejasapatil/spark,bdrillard/spark,mdespriee/spark,ahnqirage/spark,zhouyejoe/spark,shaneknapp/spark,zhouyejoe/spark,andrewor14/spark,witgo/spark,kiszk/spark,sureshthalamati/spark,rezasafi/spark,mdespriee/spark,michalsenkyr/spark,alunarbeach/spark,JoshRosen/spark,SnappyDataInc/spark,loneknightpy/spark,xflin/spark,gioenn/xSpark,mike0sv/spark,debugger87/spark,brad-kaiser/spark,zzcclp/spark,pgandhi999/spark,zhouyejoe/spark,chuckchen/spark,szhem/spark,cin/spark,aray/spark,debugger87/spark,1haodian/spark,bOOm-X/spark,cin/spark,metamx/spark,SnappyDataInc/spark,yanboliang/spark,facaiy/spark,publicRoman/spark,huang1900/spark,apache/spark,WeichenXu123/spark,brad-kaiser/spark,byakuinss/spark,Panos-Bletsos/spark-cost-model-optimizer,debugger87/spark,bdrillard/spark,kissmetrics/spark,ptkool/spark,holdenk/spark,ioana-delaney/spark,rednaxelafx/apache-spark,markhamstra/spark,spark-test/spark,gengliangwang/spark,apache-spark-on-k8s/spark,szhem/spark,alunarbeach/spark,highfei2011/spark,esi-mineset/spark,chuckchen/spark,WeichenXu123/spark,skonto/spark,byakuinss/spark,aokolnychyi/spark,tengpeng/spark,bravo-zhang/spark,hvanhovell/spark,wangyum/spark,actuaryzhang/spark,map222/spark,jiangxb1987/spark,ahnqirage/spark,highfei2011/spark,jianran/spark,saturday-shi/spark,aosagie/spark,LantaoJin/spark,ron8hu/spark,taroplus/spark,rikima/spark,loneknightpy/spark,panfengfeng/spark,shaneknapp/spark,lvdongr/spark,lvdongr/spark,rezasafi/spark,xflin/spark,zero323/spark,shubhamchopra/spark,1haodian/spark,jianran/spark,mdespriee/spark,stanzhai/spark,SHASHANKB/spark,eyalfa/spark,setjet/spark,aray/spark,markhamstra/spark,patrick-nicholson/spark,tengpeng/spark,publicRoman/spark,jkbradley/spark,HyukjinKwon/spark,witgo/spark,alunarbeach/spark,ueshin/apache-spark,ahnqirage/spark,cloud-fan/spark,SnappyDataInc/spark,haowu80s/spark,rekhajoshm/spark,andrewor14/spark,bravo-zhang/spark,debugger87/spark,yanboliang/spark,kissmetrics/spark,jlopezmalla/spark,skonto/spark,wangyum/spark,facaiy/spark,kiszk/spark,narahari92/spark,mahak/spark,JoshRosen/spark,ron8hu/spark,someorz/spark,witgo/spark,xuanyuanking/spark,wangmiao1981/spark,xflin/spark,szhem/spark,UndeadBaneGitHub/spark,darionyaphet/spark,bravo-zhang/spark,akopich/spark,rikima/spark,goldmedal/spark,caneGuy/spark,jlopezmalla/spark,mahak/spark,michalsenkyr/spark,map222/spark,shubhamchopra/spark,goldmedal/spark,icexelloss/spark,ibm-research-ireland/sparkoscope,markhamstra/spark,liyichao/spark,apache-spark-on-k8s/spark,ron8hu/spark,esi-mineset/spark,yanboliang/spark,ajaysaini725/spark,vinodkc/spark,someorz/spark,pgandhi999/spark,ConeyLiu/spark,tengpeng/spark,wangmiao1981/spark,bravo-zhang/spark,holdenk/spark,esi-mineset/spark,saltstar/spark,eyalfa/spark,caneGuy/spark,WeichenXu123/spark,nlalevee/spark,loneknightpy/spark,guoxiaolongzte/spark,alunarbeach/spark,SHASHANKB/spark,BryanCutler/spark,nchammas/spark,WindCanDie/spark,goldmedal/spark,LantaoJin/spark,andrewor14/spark,techaddict/spark,andrewor14/iolap,dongjoon-hyun/spark,alunarbeach/spark,srowen/spark,aokolnychyi/spark,hhbyyh/spark,JerryLead/spark,shuangshuangwang/spark,actuaryzhang/spark,facaiy/spark,spark-test/spark,aosagie/spark,huang1900/spark,nilsgrabbert/spark,dongjoon-hyun/spark,publicRoman/spark,sachintyagi22/spark,kiszk/spark,wangmiao1981/spark,apache-spark-on-k8s/spark,dongjoon-hyun/spark,ibm-research-ireland/sparkoscope,rezasafi/spark,metamx/spark,aokolnychyi/spark,WindCanDie/spark,ron8hu/spark,janewangfb/spark,bdrillard/spark,kimoonkim/spark,wangyum/spark,ConeyLiu/spark,SHASHANKB/spark,setjet/spark,adrian-ionescu/apache-spark,ibm-research-ireland/sparkoscope,pronix/spark,witgo/spark,dongjoon-hyun/spark,UndeadBaneGitHub/spark,aosagie/spark,ahnqirage/spark,panfengfeng/spark,nilsgrabbert/spark,darionyaphet/spark,maropu/spark,sureshthalamati/spark,zhouyejoe/spark,ptkool/spark,brad-kaiser/spark,darionyaphet/spark,zuotingbing/spark,guoxiaolongzte/spark,liyichao/spark,mahak/spark,aray/spark,loneknightpy/spark,brad-kaiser/spark,poffuomo/spark,publicRoman/spark,spark-test/spark,gengliangwang/spark,metamx/spark,holdenk/spark,actuaryzhang/spark,mzl9039/spark,lxsmnv/spark,michalsenkyr/spark,milliman/spark,matthewfranglen/spark,nchammas/spark,huang1900/spark,maropu/spark,LantaoJin/spark,mzl9039/spark,ddna1021/spark,kissmetrics/spark,taroplus/spark,nchammas/spark,shaneknapp/spark,highfei2011/spark,cin/spark,1haodian/spark,jiangxb1987/spark,eyalfa/spark,apache/spark,goldmedal/spark,xflin/spark,HyukjinKwon/spark,darionyaphet/spark,saturday-shi/spark,andrewor14/iolap,andrewor14/spark,ericvandenbergfb/spark,lvdongr/spark,patrick-nicholson/spark,wangyum/spark,ajaysaini725/spark,liutang123/spark,xflin/spark,pronix/spark,kissmetrics/spark,ibm-research-ireland/sparkoscope,JerryLead/spark,big-pegasus/spark,liyichao/spark,map222/spark,dongjoon-hyun/spark,zzcclp/spark,JoshRosen/spark,apache/spark,cloud-fan/spark,saturday-shi/spark,ahnqirage/spark,eyalfa/spark,bOOm-X/spark,sahilTakiar/spark,rednaxelafx/apache-spark,shuangshuangwang/spark,wzhfy/spark,guoxiaolongzte/spark,rekhajoshm/spark,hhbyyh/spark,rikima/spark,ericvandenbergfb/spark,kevinyu98/spark,esi-mineset/spark,tejasapatil/spark,bravo-zhang/spark,MLnick/spark,lxsmnv/spark,huang1900/spark,ddna1021/spark,zero323/spark,liyichao/spark,stanzhai/spark,ioana-delaney/spark,icexelloss/spark,icexelloss/spark,pronix/spark,sachintyagi22/spark,sahilTakiar/spark,JerryLead/spark,JerryLead/spark,yanboliang/spark,dhruve/spark,jianran/spark,adrian-ionescu/apache-spark,map222/spark,adrian-ionescu/apache-spark,shuangshuangwang/spark,publicRoman/spark,minixalpha/spark,brad-kaiser/spark,wangmiao1981/spark,darionyaphet/spark,Panos-Bletsos/spark-cost-model-optimizer,big-pegasus/spark,jiangxb1987/spark,ptkool/spark,narahari92/spark,ptkool/spark,aray/spark,patrick-nicholson/spark,yanboliang/spark,minixalpha/spark,goldmedal/spark,kimoonkim/spark,Aegeaner/spark,sahilTakiar/spark,kimoonkim/spark,WindCanDie/spark,ueshin/apache-spark,loneknightpy/spark,xuanyuanking/spark,aray/spark,goldmedal/spark,cloud-fan/spark,nilsgrabbert/spark,tejasapatil/spark,michalsenkyr/spark,HyukjinKwon/spark,panfengfeng/spark,sachintyagi22/spark,jlopezmalla/spark,BryanCutler/spark,akopich/spark,lvdongr/spark,akopich/spark,SHASHANKB/spark,UndeadBaneGitHub/spark,shaneknapp/spark,tengpeng/spark,apache/spark,bOOm-X/spark,jrshust/spark,milliman/spark,jlopezmalla/spark,saltstar/spark,bOOm-X/spark,gioenn/xSpark,saturday-shi/spark,LantaoJin/spark,gioenn/xSpark,facaiy/spark,bOOm-X/spark,WeichenXu123/spark,nlalevee/spark,poffuomo/spark,jlopezmalla/spark,sahilTakiar/spark,jkbradley/spark,andrewor14/spark,ConeyLiu/spark,caneGuy/spark,chuckchen/spark,tengpeng/spark,janewangfb/spark,bdrillard/spark,maropu/spark,alunarbeach/spark,pronix/spark,ddna1021/spark,patrick-nicholson/spark,pgandhi999/spark,ibm-research-ireland/sparkoscope,techaddict/spark,1haodian/spark,mike0sv/spark,SnappyDataInc/spark,techaddict/spark,jianran/spark,big-pegasus/spark,shuangshuangwang/spark,taroplus/spark,milliman/spark,patrick-nicholson/spark,kimoonkim/spark,michalsenkyr/spark,mzl9039/spark,jrshust/spark,rekhajoshm/spark,hhbyyh/spark,setjet/spark,nchammas/spark,taroplus/spark,bOOm-X/spark,zuotingbing/spark,wangyum/spark,shubhamchopra/spark,JoshRosen/spark,ddna1021/spark,caneGuy/spark,bdrillard/spark,huang1900/spark,kevinyu98/spark,Panos-Bletsos/spark-cost-model-optimizer,srowen/spark,hvanhovell/spark,kiszk/spark,janewangfb/spark,lvdongr/spark,someorz/spark,someorz/spark,cloud-fan/spark,SnappyDataInc/spark,brad-kaiser/spark,gioenn/xSpark,cin/spark,milliman/spark,UndeadBaneGitHub/spark,wzhfy/spark,cin/spark,guoxiaolongzte/spark,ioana-delaney/spark,liyichao/spark,narahari92/spark,zero323/spark,shuangshuangwang/spark,adrian-ionescu/apache-spark,ConeyLiu/spark,akopich/spark,gengliangwang/spark,byakuinss/spark,tejasapatil/spark,metamx/spark,wangmiao1981/spark,sachintyagi22/spark,esi-mineset/spark,zzcclp/spark,ibm-research-ireland/sparkoscope,lxsmnv/spark,tejasapatil/spark,akopich/spark,saturday-shi/spark,shuangshuangwang/spark,hhbyyh/spark,dhruve/spark,mzl9039/spark,WeichenXu123/spark,spark-test/spark,nlalevee/spark,markhamstra/spark,UndeadBaneGitHub/spark,WindCanDie/spark,ericvandenbergfb/spark,kiszk/spark,kevinyu98/spark,tejasapatil/spark,UndeadBaneGitHub/spark,szhem/spark,michalsenkyr/spark,dbtsai/spark,aokolnychyi/spark,MLnick/spark,yanboliang/spark,joseph-torres/spark,ajaysaini725/spark,shubhamchopra/spark,srowen/spark,stanzhai/spark,narahari92/spark,Panos-Bletsos/spark-cost-model-optimizer,ioana-delaney/spark,janewangfb/spark,haowu80s/spark,hvanhovell/spark,hvanhovell/spark,guoxiaolongzte/spark,poffuomo/spark,1haodian/spark,rednaxelafx/apache-spark,publicRoman/spark,map222/spark,jiangxb1987/spark,sahilTakiar/spark,patrick-nicholson/spark,wzhfy/spark,zuotingbing/spark,chuckchen/spark,minixalpha/spark,joseph-torres/spark,dhruve/spark,debugger87/spark,ueshin/apache-spark,rikima/spark,ajaysaini725/spark,aray/spark,pgandhi999/spark,sahilTakiar/spark,techaddict/spark,hhbyyh/spark,rednaxelafx/apache-spark,caneGuy/spark,kevinyu98/spark,ueshin/apache-spark,lxsmnv/spark,gengliangwang/spark,srowen/spark,eyalfa/spark,actuaryzhang/spark,rednaxelafx/apache-spark,jianran/spark,nchammas/spark,mike0sv/spark,xuanyuanking/spark,zero323/spark,sureshthalamati/spark,mike0sv/spark,cloud-fan/spark,zuotingbing/spark,jlopezmalla/spark,holdenk/spark,jiangxb1987/spark,bdrillard/spark,facaiy/spark,markhamstra/spark,mahak/spark,1haodian/spark,MLnick/spark,maropu/spark,ConeyLiu/spark,someorz/spark,1haodian/spark,ptkool/spark,cloud-fan/spark,spark-test/spark,aokolnychyi/spark,kissmetrics/spark,stanzhai/spark,poffuomo/spark,someorz/spark,haowu80s/spark,metamx/spark,taroplus/spark,MLnick/spark,pgandhi999/spark,kimoonkim/spark,apache/spark,rednaxelafx/apache-spark,zhouyejoe/spark,actuaryzhang/spark,shaneknapp/spark,nchammas/spark,LantaoJin/spark,janewangfb/spark,ioana-delaney/spark,narahari92/spark,narahari92/spark,HyukjinKwon/spark,hvanhovell/spark,jkbradley/spark,adrian-ionescu/apache-spark,wzhfy/spark,rikima/spark,mike0sv/spark,maropu/spark,chuckchen/spark,LantaoJin/spark,zero323/spark,SnappyDataInc/spark,zzcclp/spark,szhem/spark,Panos-Bletsos/spark-cost-model-optimizer,aray/spark,haowu80s/spark,HyukjinKwon/spark,apache/spark,shuangshuangwang/spark,JoshRosen/spark,haowu80s/spark,sahilTakiar/spark,rednaxelafx/apache-spark,ConeyLiu/spark,dbtsai/spark,panfengfeng/spark,dbtsai/spark,aosagie/spark,jkbradley/spark,rekhajoshm/spark,wangyum/spark,SHASHANKB/spark,bdrillard/spark,adrian-ionescu/apache-spark,jianran/spark,zuotingbing/spark,lvdongr/spark,someorz/spark,wzhfy/spark,SnappyDataInc/spark,minixalpha/spark,rekhajoshm/spark,nlalevee/spark,pronix/spark,ahnqirage/spark,liutang123/spark,huang1900/spark,JoshRosen/spark,zzcclp/spark,mzl9039/spark,liutang123/spark,sureshthalamati/spark,sureshthalamati/spark,byakuinss/spark,jkbradley/spark,cloud-fan/spark,big-pegasus/spark,zuotingbing/spark,mahak/spark,icexelloss/spark,jianran/spark,Aegeaner/spark,esi-mineset/spark,debugger87/spark,saltstar/spark,byakuinss/spark,map222/spark,Aegeaner/spark,saltstar/spark,andrewor14/iolap,michalsenkyr/spark,ron8hu/spark,wangmiao1981/spark,guoxiaolongzte/spark,srowen/spark,skonto/spark,xuanyuanking/spark,ahnqirage/spark,saltstar/spark,darionyaphet/spark,ueshin/apache-spark,goldmedal/spark,saltstar/spark,poffuomo/spark,gioenn/xSpark,joseph-torres/spark,vinodkc/spark,eyalfa/spark,holdenk/spark,andrewor14/spark,pgandhi999/spark,shubhamchopra/spark,loneknightpy/spark,dhruve/spark,shubhamchopra/spark,caneGuy/spark,minixalpha/spark,stanzhai/spark,JoshRosen/spark,maropu/spark,MLnick/spark,aokolnychyi/spark,xuanyuanking/spark,lxsmnv/spark,mdespriee/spark,rekhajoshm/spark,setjet/spark,MLnick/spark,big-pegasus/spark,joseph-torres/spark,saturday-shi/spark,lxsmnv/spark,ron8hu/spark,kimoonkim/spark,dhruve/spark,BryanCutler/spark,darionyaphet/spark,byakuinss/spark,tengpeng/spark,spark-test/spark,joseph-torres/spark,JerryLead/spark,milliman/spark,sachintyagi22/spark,ajaysaini725/spark,pronix/spark,kiszk/spark,dhruve/spark,dongjoon-hyun/spark,liyichao/spark,jkbradley/spark,SHASHANKB/spark,zero323/spark,tengpeng/spark,jkbradley/spark,mahak/spark,janewangfb/spark,mdespriee/spark,ddna1021/spark,facaiy/spark,hhbyyh/spark,nchammas/spark,aokolnychyi/spark,nlalevee/spark,gioenn/xSpark,taroplus/spark,panfengfeng/spark,debugger87/spark,nlalevee/spark,dhruve/spark,nilsgrabbert/spark,bravo-zhang/spark,zzcclp/spark,panfengfeng/spark,loneknightpy/spark,jrshust/spark,andrewor14/iolap,icexelloss/spark,poffuomo/spark,lxsmnv/spark,SHASHANKB/spark,szhem/spark,ddna1021/spark,taroplus/spark,jrshust/spark,jiangxb1987/spark,facaiy/spark,maropu/spark,gengliangwang/spark,publicRoman/spark,techaddict/spark,jrshust/spark,apache-spark-on-k8s/spark,WeichenXu123/spark,BryanCutler/spark,patrick-nicholson/spark,andrewor14/iolap,Aegeaner/spark,actuaryzhang/spark,ueshin/apache-spark,cin/spark,zhouyejoe/spark,liyichao/spark,wangmiao1981/spark,WindCanDie/spark,apache/spark,milliman/spark,hhbyyh/spark,vinodkc/spark,haowu80s/spark,highfei2011/spark,zero323/spark,narahari92/spark,highfei2011/spark,panfengfeng/spark,rezasafi/spark,rikima/spark,LantaoJin/spark,markhamstra/spark,metamx/spark,xflin/spark,caneGuy/spark,kevinyu98/spark,BryanCutler/spark,rikima/spark,ioana-delaney/spark,WeichenXu123/spark,hvanhovell/spark,JerryLead/spark,apache-spark-on-k8s/spark,dongjoon-hyun/spark,stanzhai/spark,dbtsai/spark,huang1900/spark,spark-test/spark,mike0sv/spark,techaddict/spark,ericvandenbergfb/spark,zuotingbing/spark,eyalfa/spark,Panos-Bletsos/spark-cost-model-optimizer,MLnick/spark,setjet/spark,nilsgrabbert/spark,jrshust/spark,liutang123/spark,highfei2011/spark,icexelloss/spark,dbtsai/spark,vinodkc/spark,nlalevee/spark,joseph-torres/spark,big-pegasus/spark,skonto/spark,mahak/spark,nilsgrabbert/spark,witgo/spark,WindCanDie/spark,Aegeaner/spark,zhouyejoe/spark,byakuinss/spark,holdenk/spark,kissmetrics/spark,nilsgrabbert/spark,kevinyu98/spark,brad-kaiser/spark,rezasafi/spark,dbtsai/spark,guoxiaolongzte/spark,aosagie/spark,alunarbeach/spark,zzcclp/spark,kevinyu98/spark,wangyum/spark,lvdongr/spark,shubhamchopra/spark,Aegeaner/spark,big-pegasus/spark,pgandhi999/spark,liutang123/spark,szhem/spark,ericvandenbergfb/spark,witgo/spark,mike0sv/spark,stanzhai/spark,vinodkc/spark,apache-spark-on-k8s/spark,kiszk/spark,bravo-zhang/spark,shaneknapp/spark,chuckchen/spark,saltstar/spark,sureshthalamati/spark,sachintyagi22/spark,kimoonkim/spark,srowen/spark,shaneknapp/spark,vinodkc/spark,srowen/spark,ron8hu/spark,ajaysaini725/spark,minixalpha/spark,highfei2011/spark,icexelloss/spark,jlopezmalla/spark,skonto/spark,aosagie/spark,liutang123/spark,apache-spark-on-k8s/spark,jrshust/spark,UndeadBaneGitHub/spark,xuanyuanking/spark,minixalpha/spark,map222/spark,rezasafi/spark,techaddict/spark,janewangfb/spark,ptkool/spark,setjet/spark,wzhfy/spark,bOOm-X/spark,akopich/spark,esi-mineset/spark,milliman/spark,ioana-delaney/spark,gengliangwang/spark,BryanCutler/spark,mdespriee/spark,poffuomo/spark,vinodkc/spark,skonto/spark