title: Developing Glue ETL script locally - java.lang.IllegalStateException: Connection pool shut down
body: <p>I'm currently developing ETL scripts locally using the AWS Glue ETL library.</p>
  <p>I'm facing an issue when extracting data from S3 bucket as DynamicFrame.</p>
  <p>When I want to convert to a DataFrame using toDF(), it will always trigger this exception:</p>
  <pre><code>py4j.protocol.Py4JJavaError: An error occurred while calling o52.toDF
  </code></pre>
  <p>...</p>
  <pre><code>ERROR Executor: Exception in task 5.0 in stage 3.0 (TID 29)
  java.lang.IllegalStateException: Connection pool shut down
      at org.apache.http.util.Asserts.check(Asserts.java:34)
      at org.apache.http.pool.AbstractConnPool.lease(AbstractConnPool.java:191)
      at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.requestConnection(PoolingHttpClientConnectionManager.java:267)
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.amazonaws.http.conn.ClientConnectionManagerFactory$Handler.invoke(ClientConnectionManagerFactory.java:76)
      at com.amazonaws.http.conn.$Proxy15.requestConnection(Unknown Source)
      at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:176)
      at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
      at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
      at com.amazonaws.http.apache.client.impl.SdkHttpClient.execute(SdkHttpClient.java:72)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1330)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1145)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:802)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:770)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:744)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:704)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:686)
      at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:550)
      at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:530)
      at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5062)
      at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5008)
      at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1490)
      at org.apache.hadoop.fs.s3a.S3AInputStream.reopen(S3AInputStream.java:148)
      at org.apache.hadoop.fs.s3a.S3AInputStream.lazySeek(S3AInputStream.java:281)
      at org.apache.hadoop.fs.s3a.S3AInputStream.read(S3AInputStream.java:364)
      at java.io.DataInputStream.read(DataInputStream.java:149)
      at org.apache.hadoop.io.compress.DecompressorStream.getCompressedData(DecompressorStream.java:179)
      at org.apache.hadoop.io.compress.DecompressorStream.decompress(DecompressorStream.java:163)
      at org.apache.hadoop.io.compress.DecompressorStream.read(DecompressorStream.java:105)
      at java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
      at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
      at com.amazonaws.services.glue.readers.BufferedStream.read(DynamicRecordReader.scala:91)
      at com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper.ensureLoaded(ByteSourceJsonBootstrapper.java:489)
      at com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper.detectEncoding(ByteSourceJsonBootstrapper.java:126)
      at com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper.constructParser(ByteSourceJsonBootstrapper.java:215)
  </code></pre>
  <p>I tried the same code on AWS Glue DevEndpoint and it works fine. Any idea how to resolve this?</p>