[jira] [Created] (HADOOP-15372) Race conditions and possible leaks in the Shell class

2018-04-06 Thread Miklos Szegedi (JIRA)
Miklos Szegedi created HADOOP-15372:
---

 Summary: Race conditions and possible leaks in the Shell class
 Key: HADOOP-15372
 URL: https://issues.apache.org/jira/browse/HADOOP-15372
 Project: Hadoop Common
  Issue Type: Bug
Affects Versions: 2.10.0, 3.2.0
Reporter: Miklos Szegedi


YARN-5641 introduced some cleanup code in the Shell class. It has a race 
condition. {{Shell.

runCommand()}} can be called while/after {{Shell.getAllShells()}} returned all 
the shells to be cleaned up. This new thread can avoid the clean up, so that 
the process held by it can be leaked causing leaked localized files/etc.

I also see an unrelated issue as well. {{Shell.runCommand()}} has a finally 
block with a {{

process.destroy();}} to clean up. However, the try catch block does not cover 
all instructions after the process is started, so for example we can exit the 
thread and leak the process, if {{

timeOutTimer.schedule(timeoutTimerTask, timeOutInterval);}} causes an exception.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: common-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-dev-h...@hadoop.apache.org



[jira] [Created] (HADOOP-15331) Race conditions caused by org.apache.hadoop.conf.Configuration: error parsing conf java.io.BufferedInputStream

2018-03-20 Thread Miklos Szegedi (JIRA)
Miklos Szegedi created HADOOP-15331:
---

 Summary: Race conditions caused by 
org.apache.hadoop.conf.Configuration: error parsing conf 
java.io.BufferedInputStream
 Key: HADOOP-15331
 URL: https://issues.apache.org/jira/browse/HADOOP-15331
 Project: Hadoop Common
  Issue Type: Bug
  Components: common
Affects Versions: 3.0.0, 2.7.5, 2.8.3, 2.9.0, 3.1.0, 2.10.0
Reporter: Miklos Szegedi
Assignee: Miklos Szegedi


There is a race condition in the way Hadoop handles the Configuration class. 
The scenario is the following. Let's assume that there are two threads sharing 
the same Configuration class. One adds some resources to the configuration, 
while the other one clones it. Resources are loaded lazily in a deferred call 
to {{loadResources()}}. If the cloning happens after adding the resources but 
before parsing them, some temporary resources like input stream pointers are 
cloned. Eventually both copies will load the input stream resources pointing to 
the same input streams. One parses the input stream XML and closes it updating 
it's own copy of the resource. The other one has another pointer to the same 
input stream. When it tries to load it, it will crash with a stream closed 
exception.

Here is an example unit test:
{code:java}
@Test
public void testResourceRace() throws Exception {
  InputStream is = new InputStream() {
InputStream is =
new ByteArrayInputStream(
"".getBytes());
@Override
public int read() throws IOException {
  return is.read();
}
  };
  Configuration conf = new Configuration();
  conf.addResource(new BufferedInputStream(is));
  Configuration confClone = new Configuration(conf);
  confClone.get("firstParse");
  conf.get("secondParse");
}{code}
Example real world stack traces:
{code:java}
2018-02-28 08:23:19,589 ERROR org.apache.hadoop.conf.Configuration: error 
parsing conf java.io.BufferedInputStream@7741d346
com.ctc.wstx.exc.WstxIOException: Stream closed
at 
com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:578)
at 
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:633)
at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2803)
at 
org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2853)
at 
org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2817)
at 
org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2689)
at org.apache.hadoop.conf.Configuration.get(Configuration.java:1420)
at 
org.apache.hadoop.security.authorize.ServiceAuthorizationManager.refreshWithLoadedConfiguration(ServiceAuthorizationManager.java:161)
at 
org.apache.hadoop.ipc.Server.refreshServiceAclWithLoadedConfiguration(Server.java:607)
at 
org.apache.hadoop.yarn.server.resourcemanager.AdminService.refreshServiceAcls(AdminService.java:586)
at 
org.apache.hadoop.yarn.server.resourcemanager.AdminService.startServer(AdminService.java:188)
at 
org.apache.hadoop.yarn.server.resourcemanager.AdminService.serviceStart(AdminService.java:165)
at 
org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)
at 
org.apache.hadoop.service.CompositeService.serviceStart(CompositeService.java:121)
at 
org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.serviceStart(ResourceManager.java:1231)
at 
org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)
at 
org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.main(ResourceManager.java:1421)
{code}
Another example:
{code:java}
2018-02-28 08:23:20,702 ERROR org.apache.hadoop.conf.Configuration: error 
parsing conf java.io.BufferedInputStream@7741d346
com.ctc.wstx.exc.WstxIOException: Stream closed
at 
com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:578)
at 
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:633)
at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2803)
at 
org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2853)
at 
org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2817)
at 
org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2689)
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1326)
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1298)
at 
org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebApp.buildRedirectPath(RMWebApp.java:103)
at 
org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebApp.getRedirectPath(RMWebApp.java:91)
at 
org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebAppFilter.doFilter(RMWebAppFilter.java:125)
at 

[jira] [Created] (HADOOP-14974) org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation fails in trunk

2017-10-23 Thread Miklos Szegedi (JIRA)
Miklos Szegedi created HADOOP-14974:
---

 Summary: 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation
 fails in trunk
 Key: HADOOP-14974
 URL: https://issues.apache.org/jira/browse/HADOOP-14974
 Project: Hadoop Common
  Issue Type: Bug
Reporter: Miklos Szegedi
Assignee: John Zhuge
Priority: Blocker


{code}
org.apache.hadoop.metrics2.MetricsException: Metrics source 
QueueMetrics,q0=root already exists!

at 
org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.newSourceName(DefaultMetricsSystem.java:152)
at 
org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.sourceName(DefaultMetricsSystem.java:125)
at 
org.apache.hadoop.metrics2.impl.MetricsSystemImpl.register(MetricsSystemImpl.java:239)
at 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueueMetrics.forQueue(CSQueueMetrics.java:141)
at 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AbstractCSQueue.(AbstractCSQueue.java:131)
at 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.ParentQueue.(ParentQueue.java:90)
at 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerQueueManager.parseQueue(CapacitySchedulerQueueManager.java:267)
at 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerQueueManager.initializeQueues(CapacitySchedulerQueueManager.java:158)
at 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler.initializeQueues(CapacityScheduler.java:639)
at 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler.initScheduler(CapacityScheduler.java:331)
at 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler.serviceInit(CapacityScheduler.java:391)
at 
org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
at 
org.apache.hadoop.service.CompositeService.serviceInit(CompositeService.java:108)
at 
org.apache.hadoop.yarn.server.resourcemanager.ResourceManager$RMActiveServices.serviceInit(ResourceManager.java:756)
at 
org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
at 
org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.createAndInitActiveServices(ResourceManager.java:1152)
at 
org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.serviceInit(ResourceManager.java:317)
at 
org.apache.hadoop.yarn.server.resourcemanager.MockRM.serviceInit(MockRM.java:1313)
at 
org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
at 
org.apache.hadoop.yarn.server.resourcemanager.MockRM.(MockRM.java:161)
at 
org.apache.hadoop.yarn.server.resourcemanager.MockRM.(MockRM.java:140)
at 
org.apache.hadoop.yarn.server.resourcemanager.MockRM.(MockRM.java:136)
at 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestContainerAllocation.testExcessReservationThanNodeManagerCapacity(TestContainerAllocation.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at 
org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: common-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-dev-h...@hadoop.apache.org



[jira] [Created] (HADOOP-13977) IntelliJ Compilation error in ITUseMiniCluster.java

2017-01-11 Thread Miklos Szegedi (JIRA)
Miklos Szegedi created HADOOP-13977:
---

 Summary: IntelliJ Compilation error in ITUseMiniCluster.java
 Key: HADOOP-13977
 URL: https://issues.apache.org/jira/browse/HADOOP-13977
 Project: Hadoop Common
  Issue Type: Bug
Reporter: Miklos Szegedi
Assignee: Sean Busbey


The repro steps:
mvn clean install -DskipTests and then "Build/Build Project" in IntelliJ IDEA 
to update indexes, etc.
...hadoop/hadoop-client-modules/hadoop-client-integration-tests/src/test/java/org/apache/hadoop/example/ITUseMiniCluster.java
Error:(34, 28) java: package org.apache.hadoop.fs does not exist
...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: common-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-dev-h...@hadoop.apache.org



[jira] [Created] (HADOOP-13963) /bin/bash is hard coded in some of the scripts

2017-01-09 Thread Miklos Szegedi (JIRA)
Miklos Szegedi created HADOOP-13963:
---

 Summary: /bin/bash is hard coded in some of the scripts
 Key: HADOOP-13963
 URL: https://issues.apache.org/jira/browse/HADOOP-13963
 Project: Hadoop Common
  Issue Type: Bug
Reporter: Miklos Szegedi


/bin/bash is hard coded in some of the scripts. We should consider using 
#!/usr/bin/env bash at the beginning instead.
Candidates:
hadoop-functions_test_helper.bash
start-build-env.sh
findHangingTest.sh
verify-xml.sh
hadoop_env_checks.sh




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: common-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-dev-h...@hadoop.apache.org