提交 699994af 编写于 作者: C csahu

8154144: Tests in com/sun/jdi fails intermittently with "jdb input stream closed prematurely"

Summary: Don't print stream closed message during shutdown
Reviewed-by: dcubed, sla, dsamersoff
Contributed-by: sharath.ballal@oracle.com
上级 a2a17e48
/*
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -133,6 +133,10 @@ public class EventHandler implements Runnable {
if (!vmDied) {
vmDisconnectEvent(event);
}
/*
* Inform jdb command line processor that jdb is being shutdown. JDK-8154144.
*/
((TTY)notifier).setShuttingDown(true);
Env.shutdown(shutdownMessageKey);
return false;
} else {
......
/*
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -56,6 +56,16 @@ public class TTY implements EventNotifier {
*/
private static final String progname = "jdb";
private volatile boolean shuttingDown = false;
public void setShuttingDown(boolean s) {
shuttingDown = s;
}
public boolean isShuttingDown() {
return shuttingDown;
}
@Override
public void vmStartEvent(VMStartEvent se) {
Thread.yield(); // fetch output
......@@ -750,7 +760,13 @@ public class TTY implements EventNotifier {
while (true) {
String ln = in.readLine();
if (ln == null) {
MessageOutput.println("Input stream closed.");
/*
* Jdb is being shutdown because debuggee exited, ignore any 'null'
* returned by readLine() during shutdown. JDK-8154144.
*/
if (!isShuttingDown()) {
MessageOutput.println("Input stream closed.");
}
ln = "quit";
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册