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

consumer 抛出Dubbo client can not supported string message原因分析 #2006

Closed
2 tasks done
fingthinking opened this issue Jun 29, 2018 · 15 comments
Closed
2 tasks done
Labels
type/need-triage Need maintainers to triage

Comments

@fingthinking
Copy link

fingthinking commented Jun 29, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.
  • Operating System version: mac
  • Java version: 1.8

Step to reproduce this issue

  1. 表现:
    consumer 在某些情况下会抛出Dubbo client can not supported string message异常,并且 message 显示为乱码信息,经查找资料是说消息体 >8M 导致;
  2. 实际测试结果:
    我本地测试的时候,均无法复现对应的异常信息,>8M 的表现为 consumer 等待超时,且 provider 抛出Data length too large:异常。

求大神们帮忙分析一下,在什么情况下会出现标题中的那种异常?

@fingthinking
Copy link
Author

@beiwei30 hi,能帮忙看看吗

@chickenlj chickenlj added the type/need-triage Need maintainers to triage label Jul 9, 2018
@chickenlj
Copy link
Contributor

Can you please give a full stack trace.

@beiwei30
Copy link
Member

@fingthinking this error log comes from https://github.com/apache/incubator-dubbo/blob/master/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/header/HeaderExchangeHandler.java#L204. Would you mind to attach the relevant info from your dubbo log so that we can analyze further based on that?

@zane-rl
Copy link

zane-rl commented Aug 2, 2018

线上碰到一样的错误:
2018-08-02 17:36:16 [com.alibaba.dubbo.common.logger.slf4j.Slf4jLogger:74] - [DUBBO] Dubbo client can not supported string message: 慩試ZC0(com.tontisa.erpweb.entity.BaseLineTravel�^BID^EerpID^FlineID^FtheDay
theTraffic^GtheFrom^EtheTtheTitle^GtheDestheHotel^FtheCan theFlight^FbySort^FisLock^EadmID^EisDel^Cimg theScenic
updateTime^GaddTime^VbaseLineTravelJourneys<画NN�^B椋炴満NN^L绂忓窞/鍘﹂棬-棣欐腐-閲戣竟 0@璐靛浜庢寚瀹氭椂闂撮泦鍚堜簬鏈哄満鍥介檯鏈哄満鍥介檯鍑哄彂鍘咃紝鎼箻璞崕>瀹㈡満缁忛娓浆鏈洪寰�鏌煍瀵ㄩ閮解�斺�滀笢鏂瑰皬宸撮粠鈥濋噾杈瑰競锛屾櫄椁愬悗涔樿溅鍓嶅線閰掑簵鍏ヤ綇銆�^F褰撳湴4鏄熼厭搴�^A鏅歂悙<'^_N1^G/erp_files/files/336/image/20160219/20150228124025_kcQsy.thumb.700_0_1455850382673.jpeg,/erp_files/files/336/image/20160219/20150226110304_dYmVL.thumb.700_0_1455850382774.jpeg,/erp_files/files/336/image/20160219/20150228111736_LzFMM.thumb.700_0_1455850382791.jpegNJ^@^@^Aat%L^OJ^@^@^Aat%K揘<^\ENN�^E澶у反銆侀鏈篘D1绂忓窞-鏇艰胺 02璐靛浜庢寚瀹氭椂闂村強鍦扮....................................
at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) [dubbo-2.8.4.jar:2.8.4]
at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) [dubbo-2.8.4.jar:2.8.4]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_65]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65]

消费端错误返回如上:
1、服务端设置过(查资料有说可能数据太大):
<dubbo:protocol name="dubbo" port="20893" register="${service.register}" payload="33554432"/>
依然有问题
2、实体类BaseLineTravel:
public class BaseLineTravel implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private Long ID;
private Integer isDel;
private String img;
private String theScenic;

private List<BaseLineTravelJourney> baseLineTravelJourneys;

....
有做序列化处理,BaseLineTravelJourney:
public class BaseLineTravelJourney implements java.io.Serializable 也有处理

@chickenlj @beiwei30

@fingthinking
Copy link
Author

@chickenlj @beiwei30 今天又遇到同样的问题了,我怎么也无法分析出来原因,哎~同楼上代码类似,麻烦两位帮忙分析一下。

@lllichen
Copy link
Contributor

@renlei413326889 问下你用的啥序列化协议呢,换个协议还报错吗

@zane-rl
Copy link

zane-rl commented Aug 24, 2018

@lllichen 默认的dubbo协议 <dubbo:protocol name="dubbo" dubbox最新分支

@fingthinking
Copy link
Author

@fingthinking
Copy link
Author

@renlei413326889 看看是不是因为这个原因,我在我们公司这么修复的,没毛病。

@zonghaishang
Copy link
Member

Are you using telnet in consumer side ?

@zonghaishang
Copy link
Member

at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) [dubbo-2.8.4.jar:2.8.4

Have you tried using dubbo (not dubbox) to reproduce it?

@fingthinking
Copy link
Author

Are you using telnet in consumer side ?

是的,使用的 dubbox

@zane-rl
Copy link

zane-rl commented Oct 13, 2018

@fingthinking 我按照你的这样处理了,没毛病!现在没有这种乱码问题,最新的dubbo的代码也有处理这种异常情况!

@beiwei30
Copy link
Member

beiwei30 commented Nov 8, 2018

@renlei413326889 @fingthinking, dubbo 现在代码里的:

        } catch (Throwable t) {
            // clear buffer
            buffer.writerIndex(savedWriteIndex);
            // send error message to Consumer, otherwise, Consumer will wait till timeout.
            if (!res.isEvent() && res.getStatus() != Response.BAD_RESPONSE) {

buffer.writerIndex(savedWriteIndex); 已经解决了这个问题了吧?

@zonghaishang
Copy link
Member

看回复已经解决了,我check了代码 buffer.writerIndex(savedWriteIndex);buffer.clear()是等价的,先关闭这个Issue。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/need-triage Need maintainers to triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants