Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEZ-4501: Fix TestLocalMode timeouts #300

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,12 @@ public void run() {
Event event;
try {
event = eventQueue.take();
if (LOG.isTraceEnabled()) {
LOG.trace("AsyncDispatcher taken event: {}", event);
}
} catch(InterruptedException ie) {
if (!stopped) {
LOG.warn("AsyncDispatcher thread interrupted", ie);
LOG.warn("AsyncDispatcher thread interrupted (while taking event)", ie);
}
return;
}
Expand Down Expand Up @@ -140,6 +143,8 @@ public void setDrainEventsOnStop() {

@Override
protected void serviceStop() throws Exception {
LOG.info("AsyncDispatcher serviceStop called, drainEventsOnStop: {}, drained: {}, eventQueue size: {}",
drainEventsOnStop, drained, eventQueue.size());
if (drainEventsOnStop) {
blockNewEvents = true;
LOG.info("AsyncDispatcher is draining to stop, ignoring any new events.");
Expand All @@ -148,7 +153,7 @@ protected void serviceStop() throws Exception {
TezConfiguration.TEZ_AM_DISPATCHER_DRAIN_EVENTS_TIMEOUT_DEFAULT);

synchronized (waitForDrained) {
while (!drained && eventHandlingThread.isAlive() && System.currentTimeMillis() < endTime) {
while (!eventQueue.isEmpty() && eventHandlingThread.isAlive() && System.currentTimeMillis() < endTime) {
ayushtkn marked this conversation as resolved.
Show resolved Hide resolved
waitForDrained.wait(1000);
LOG.info(
"Waiting for AsyncDispatcher to drain. Current queue size: {}, handler thread state: {}",
Expand Down Expand Up @@ -364,9 +369,12 @@ public void handle(Event event) {
}
try {
eventQueue.put(event);
if (LOG.isTraceEnabled()) {
LOG.trace("AsyncDispatcher put event: {}", event);
}
} catch (InterruptedException e) {
if (!stopped) {
LOG.warn("AsyncDispatcher thread interrupted", e);
LOG.warn("AsyncDispatcher thread interrupted (while putting event): {}", event, e);
}
throw new YarnRuntimeException(e);
}
Expand Down
Loading