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

拦截器点击第10次无效 #893

Open
listen2code opened this issue Jan 17, 2021 · 4 comments
Open

拦截器点击第10次无效 #893

listen2code opened this issue Jan 17, 2021 · 4 comments

Comments

@listen2code
Copy link

listen2code commented Jan 17, 2021

https://www.aipiti.cn/read/4e26dbd2-97d8-11e9-b583-525400bcb43b
文章中的问题我也遇到了,Postcard.timeOut改成小点,就可以修复了,这里的原理是啥, 修改timeOut是否会有问题?是否有更好解决方案?

yongjun310 added a commit to yongjun310/ARouter that referenced this issue Jan 21, 2021
优化:当Interceptor的process未回调onContinue或者onInterrupt时,框架默认让拦截链继续下去。防止CountDownLatch始终未到0,线程必须等待300s超时,防止线程池等待队列满掉。
@yongjun310
Copy link

文章中提到的将timeout改成小点并没有根本性的解决问题,会导致LogisticsCenter.executor线程池的等待队列会长时间处于满的状态,导致无法接收新的任务,出现不可预测的问题。

@zhi1ong
Copy link
Member

zhi1ong commented Jan 29, 2021

核心问题是拦截器的 API 设计的有问题,需要显式调用 onContinue 或者 onInterrupt,否则线程会一直占着

@QianHong
Copy link

请问大佬们,我在拦截器的process中使用 postcard.setTimeout(2);然而并没有用,点击10次后还是会无效。不知道是不是我的使用方法有问题呢,求解。

@dushicai
Copy link

点击9次或者5次后拦截器无效对应的是LogisticsCenter.executor核心线程数
拦截器中部分InterceptorCallback未调用 onContinue 或 onInterrupt导致LogisticsCenter.executor无法处理新任务
解决1: setTimeout让LogisticsCenter.executor可以执行新的任务(超时会导致:NavCallback->onInterrupt)
解决2:处理拦截器中未调用 onContinue 或 onInterrupt的InterceptorCallback,不想手动处理页面可以设置setTimeout(1)

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

No branches or pull requests

5 participants