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

[Improvement] Fast fail when grpc request encounter unable to create new native thread exception #1267

Closed
3 tasks done
zuston opened this issue Oct 27, 2023 · 0 comments · Fixed by #1344
Closed
3 tasks done

Comments

@zuston
Copy link
Member

zuston commented Oct 27, 2023

Code of Conduct

Search before asking

  • I have searched in the issues and found no similar issues.

What would you like to be improved?

In online applications, I found the some jobs will hang when encountering the exception as follows

23/10/27 07:54:32 ERROR ManagedChannelImpl: [Channel<27>: (10.67.67.91:21000)] Uncaught exception in the SynchronizationContext. Panic!
java.lang.OutOfMemoryError: unable to create new native thread
	at java.lang.Thread.start0(Native Method)
	at java.lang.Thread.start(Thread.java:714)
	at io.grpc.netty.shaded.io.netty.util.concurrent.ThreadPerTaskExecutor.execute(ThreadPerTaskExecutor.java:32)
	at io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$1.execute(ThreadExecutorMap.java:57)
	at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.doStartThread(SingleThreadEventExecutor.java:975)
	at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.startThread(SingleThreadEventExecutor.java:944)
	at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:827)
	at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.lazyExecute(SingleThreadEventExecutor.java:820)
	at io.grpc.netty.shaded.io.netty.util.concurrent.AbstractScheduledEventExecutor.schedule(AbstractScheduledEventExecutor.java:263)
	at io.grpc.netty.shaded.io.netty.util.concurrent.AbstractScheduledEventExecutor.schedule(AbstractScheduledEventExecutor.java:177)
	at io.grpc.netty.shaded.io.netty.util.concurrent.AbstractEventExecutorGroup.schedule(AbstractEventExecutorGroup.java:50)
	at io.grpc.netty.shaded.io.netty.util.concurrent.AbstractEventExecutorGroup.schedule(AbstractEventExecutorGroup.java:32)
	at io.grpc.internal.Rescheduler.reschedule(Rescheduler.java:63)
	at io.grpc.internal.ManagedChannelImpl.rescheduleIdleTimer(ManagedChannelImpl.java:447)
	at io.grpc.internal.ManagedChannelImpl.exitIdleMode(ManagedChannelImpl.java:402)
	at io.grpc.internal.ManagedChannelImpl$RealChannel$2.run(ManagedChannelImpl.java:984)
	at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:95)
	at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:127)
	at io.grpc.internal.ManagedChannelImpl$RealChannel.newCall(ManagedChannelImpl.java:981)
	at org.apache.uniffle.client.impl.grpc.RetryInterceptor$1RetryingUnaryRequestClientCall.startCall(RetryInterceptor.java:98)
	at org.apache.uniffle.client.impl.grpc.RetryInterceptor$1RetryingUnaryRequestClientCall.halfClose(RetryInterceptor.java:94)
	at io.grpc.stub.ClientCalls.asyncUnaryRequestCall(ClientCalls.java:318)
	at io.grpc.stub.ClientCalls.futureUnaryCall(ClientCalls.java:227)
	at org.apache.uniffle.proto.ShuffleServerGrpc$ShuffleServerFutureStub.requireBuffer(ShuffleServerGrpc.java:920)
	at org.apache.uniffle.client.impl.grpc.ShuffleServerGrpcClient.doRequirePreAllocation(ShuffleServerGrpcClient.java:291)
	at org.apache.uniffle.client.impl.grpc.ShuffleServerGrpcClient.requirePreAllocation(ShuffleServerGrpcClient.java:277)
	at org.apache.uniffle.client.impl.grpc.ShuffleServerGrpcClient.lambda$sendShuffleData$3(ShuffleServerGrpcClient.java:405)
	at org.apache.uniffle.common.util.RetryUtils.retry(RetryUtils.java:49)
	at org.apache.uniffle.common.util.RetryUtils.retry(RetryUtils.java:31)
	at org.apache.uniffle.client.impl.grpc.ShuffleServerGrpcClient.sendShuffleData(ShuffleServerGrpcClient.java:400)
	at org.apache.uniffle.client.impl.ShuffleWriteClientImpl.lambda$sendShuffleDataAsync$4(ShuffleWriteClientImpl.java:239)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

And the retry will cost too much time and always fail. So I want to exclude this exception when retrying

How should we improve?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
zuston added a commit to zuston/incubator-uniffle that referenced this issue Dec 1, 2023
zuston added a commit to zuston/incubator-uniffle that referenced this issue Dec 8, 2023
zuston added a commit that referenced this issue Dec 8, 2023
### What changes were proposed in this pull request?

 fast fail without retry when oom occurs

### Why are the changes needed?

Fix: #1267 

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing UTs
xianjingfeng pushed a commit that referenced this issue Dec 13, 2023
### What changes were proposed in this pull request?

 fast fail without retry when oom occurs

### Why are the changes needed?

Fix: #1267

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing UTs

(cherry picked from commit eb88143)
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Dec 30, 2023
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Dec 30, 2023
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Jan 5, 2024
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Jan 8, 2024
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Jan 8, 2024
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Jan 13, 2024
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Jan 13, 2024
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Jan 13, 2024
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Jan 13, 2024
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Jan 13, 2024
zuston pushed a commit that referenced this issue Jan 15, 2024
…tions happened (#1411)

### What changes were proposed in this pull request?

Save the previous exception in advance to prevent it from being lost during the next retry.

### Why are the changes needed?

This is the follow up pr of  [#1344](#1344)

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing UTs.
zuston added a commit to zuston/incubator-uniffle that referenced this issue Jan 18, 2024
…pache#1344)

### What changes were proposed in this pull request?

 fast fail without retry when oom occurs

### Why are the changes needed?

Fix: apache#1267 

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing UTs
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Feb 1, 2024
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Feb 4, 2024
rickyma added a commit to rickyma/incubator-uniffle that referenced this issue Feb 4, 2024
smallzhongfeng pushed a commit that referenced this issue Feb 6, 2024
…in RetryUtils (#1500)

### What changes were proposed in this pull request?

INFO log level should be used in RetryUtils. Because these log messages are not actual errors.

### Why are the changes needed?

It's a followup PR for [#1411](#1411).

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing UTs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant