java多线程应用程序-在配置单元上间歇性出现“错误文件描述符”异常

qvtsj1bj  于 2021-05-31  发布在  Hadoop
关注(0)|答案(0)|浏览(285)

我知道以前有人问过这样的问题,但是我看了他们的帖子后还是没有得到答案,所以我决定从这里再发一次这个问题。
我正在开发java多线程应用程序,尝试在hive环境中使用jdbc运行hql查询。我有一堆配置单元sql查询,我在配置单元上用多个线程并行执行它们,当查询计数更多时(例如,如果我运行的查询超过100个),我会遇到以下异常。有人能帮我查一下这个吗?

2020-06-16 06:00:45,314 ERROR [main]: Terminal exception
java.lang.Exception: Map step agg_cas_auth_reinstate_derive failed.
    at com.mine.idn.magellan.ParallelExecGraph.execute(ParallelExecGraph.java:198)
    at com.mine.idn.magellan.WarehouseSession.executeMap(WarehouseSession.java:332)
    at com.mine.idn.magellan.StandAloneEnv.execute(StandAloneEnv.java:872)
    at com.mine.idn.magellan.StandAloneEnv.execute(StandAloneEnv.java:778)
    at com.mine.idn.magellan.StandAloneEnv.executeAndExit(StandAloneEnv.java:642)
    at com.mine.idn.magellan.StandAloneEnv.main(StandAloneEnv.java:77)
Caused by: java.sql.SQLException: org.apache.hive.service.cli.HiveSQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask. java.io.IOException: Bad file descriptor
    at org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:380)
    at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:257)
    at org.apache.hive.service.cli.operation.SQLOperation.access$800(SQLOperation.java:91)
    at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:348)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1669)
    at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:362)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: java.io.IOException: Bad file descriptor
    at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2850)
    at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2685)
    at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2591)
    at org.apache.hadoop.conf.Configuration.get(Configuration.java:1077)
    at org.apache.hadoop.mapred.JobConf.checkAndWarnDeprecation(JobConf.java:2007)
    at org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:479)
    at org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:469)
    at org.apache.hadoop.mapreduce.Cluster.getJob(Cluster.java:190)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:601)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:599)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1669)
    at org.apache.hadoop.mapred.JobClient.getJobUsingCluster(JobClient.java:599)
    at org.apache.hadoop.mapred.JobClient.getJobInner(JobClient.java:609)
    at org.apache.hadoop.mapred.JobClient.getJob(JobClient.java:639)
    at org.apache.hadoop.hive.ql.exec.mr.HadoopJobExecHelper.progress(HadoopJobExecHelper.java:295)
    at org.apache.hadoop.hive.ql.exec.mr.HadoopJobExecHelper.progress(HadoopJobExecHelper.java:559)
    at org.apache.hadoop.hive.ql.exec.mr.ExecDriver.execute(ExecDriver.java:425)
    at org.apache.hadoop.hive.ql.exec.mr.MapRedTask.execute(MapRedTask.java:151)
    at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:201)
    at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100)
    at org.apache.hadoop.hive.ql.exec.TaskRunner.run(TaskRunner.java:79)
Caused by: java.io.IOException: Bad file descriptor
    at java.io.FileInputStream.close0(Native Method)
    at java.io.FileInputStream.access$000(FileInputStream.java:49)
    at java.io.FileInputStream$1.close(FileInputStream.java:336)
    at java.io.FileDescriptor.closeAll(FileDescriptor.java:212)
    at java.io.FileInputStream.close(FileInputStream.java:334)
    at java.io.BufferedInputStream.close(BufferedInputStream.java:483)
    at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2676)
    at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2661)
    at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2741)
    ... 22 more

    at org.apache.hive.jdbc.HiveStatement.waitForOperationToComplete(HiveStatement.java:385)
    at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254)
    at com.mine.idn.magellan.WarehouseSession.executeMapStep(WarehouseSession.java:797)
    at com.mine.idn.magellan.WarehouseSession.access$000(WarehouseSession.java:23)
    at com.mine.idn.magellan.WarehouseSession$ParallelExecResources.executeMapStep(WarehouseSession.java:91)
    at com.mine.idn.magellan.ParallelExecGraph$Node.run(ParallelExecGraph.java:85)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

我不明白的是,为什么hadoop框架会抛出错误的文件描述符异常?我的java代码调用hadoop配置单元代码并引发这个异常。
还有一件事是这个问题是间歇性的,不一致。如果我重新运行同一个应用程序,大多数情况下,它都会通过。
谢谢你的帮助

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题