Вот моя проблема:
Пожалуйста, обратитесь к снимку
снимок журналов
2018-12-01 16:03:24.634 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.handler.ASRHandler : 收到Up请求, id=76cfe0da-6f09-43ef-91a4-53c395387aa4, ak=ca5a1988599987899435bd51e76e2d5c73605519
2018-12-01 16:03:24.634 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.access.TokenManager : 当前Token: ca5a1988599987899435bd51e76e2d5c73605519, 不存在: false
2018-12-01 16:03:24.650 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 1, 耗时: 16
2018-12-01 16:03:24.651 INFO 11528 --- [pool-1-thread-1] com.asrapi.service.HTTPService : Up上行 POST-ASR开始:1543651404651
2018-12-01 16:03:24.793 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 159
2018-12-01 16:03:24.964 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 330
2018-12-01 16:03:25.138 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 504
2018-12-01 16:03:25.306 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 672
2018-12-01 16:03:25.470 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 836
2018-12-01 16:03:25.641 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 1007
2018-12-01 16:03:25.805 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 1171
2018-12-01 16:03:25.971 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 1337
2018-12-01 16:03:26.110 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.handler.ASRHandler : 收到Down请求, id=76cfe0da-6f09-43ef-91a4-53c395387aa4, ak=ca5a1988599987899435bd51e76e2d5c73605519
2018-12-01 16:03:26.110 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.access.TokenManager : 当前Token: ca5a1988599987899435bd51e76e2d5c73605519, 不存在: false
2018-12-01 16:03:26.110 INFO 11528 --- [pool-1-thread-1] com.asrapi.service.HTTPService : Down下行 POST-ASR开始:1543651406110
2018-12-01 16:03:26.191 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : Down POST-ASR响应总耗时:81
2018-12-01 16:03:26.191 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : http://audiotest.baidu.com/open_asr_test/down?id=76cfe0da-6f09-43ef-91a4-53c395387aa4, resp_code:200
2018-12-01 16:03:26.191 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : http://audiotest.baidu.com/open_asr_test/down?id=76cfe0da-6f09-43ef-91a4-53c395387aa4, resp_message:OK
2018-12-01 16:03:26.191 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : http://audiotest.baidu.com/open_asr_test/down?id=76cfe0da-6f09-43ef-91a4-53c395387aa4, resp_encoding:chunked
2018-12-01 16:03:26.191 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : http://audiotest.baidu.com/open_asr_test/down?id=76cfe0da-6f09-43ef-91a4-53c395387aa4, resp_protocol:http/1.1
2018-12-01 16:03:26.191 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : ASR response, type: 4, time: 1543651406191
2018-12-01 16:03:36.090 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : ASR response, type: 5, time: 1543651416090
2018-12-01 16:03:36.090 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.utils.ASRUtil : Web response type: 5
2018-12-01 16:03:36.091 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.utils.ASRUtil : Last NLU response type: 5
id: "76cfe0da-6f09-43ef-91a4-53c395387aa4"
err_no: -3001
err_msg: "server read sdk error, not ltv struct"
last <
>
2018-12-01 16:03:36.093 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 11459
2018-12-01 16:03:36.093 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 11459
2018-12-01 16:03:36.093 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 11459
2018-12-01 16:03:36.093 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 11459
2018-12-01 16:03:36.093 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 11459
2018-12-01 16:03:36.093 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 2, 耗时: 11459
2018-12-01 16:03:36.093 INFO 11528 --- [ XNIO-1 I/O-1] com.asrapi.service.HTTPService : receive msg: 3, 耗时: 11459
2018-12-01 16:03:36.110 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : http://audiotest.baidu.com/open_asr_test/down?id=76cfe0da-6f09-43ef-91a4-53c395387aa4, response text:
2018-12-01 16:03:36.126 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : Up POST-ASR响应总耗时:11475
2018-12-01 16:03:36.126 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : http://audiotest.baidu.com/open_asr_test/up?id=76cfe0da-6f09-43ef-91a4-53c395387aa4, resp_code:200
2018-12-01 16:03:36.126 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : http://audiotest.baidu.com/open_asr_test/up?id=76cfe0da-6f09-43ef-91a4-53c395387aa4, resp_message:OK
2018-12-01 16:03:36.126 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : http://audiotest.baidu.com/open_asr_test/up?id=76cfe0da-6f09-43ef-91a4-53c395387aa4, resp_encoding:null
2018-12-01 16:03:36.126 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : http://audiotest.baidu.com/open_asr_test/up?id=76cfe0da-6f09-43ef-91a4-53c395387aa4, resp_protocol:http/1.1
2018-12-01 16:03:36.126 INFO 11528 --- [t.baidu.com/...] com.asrapi.service.HTTPService : http://audiotest.baidu.com/open_asr_test/up?id=76cfe0da-6f09-43ef-91a4-53c395387aa4, response text:
Из журналов, как указано выше, мы видим, что запрос "Вниз" вешает запрос "Вверх", а запрос "Вверх" продолжается, когда запрос "Двон" завершается.
Вопрос 1 : Я не знаю, почему запрос зависал.
Вопрос 2 : Я хочу знать, почему выполняются два запроса с одним и тем же потоком NIO.
Вопрос 3 : я хочу знать, почему Undertow блокирует NOT блокировку запроса "dwon" снаружи, если у Undertow остался только один единственный поток NIO, или почему Udertow делает НЕ использовать два потока NIO для обработки запросов "вверх" и "вниз", если в Undertow все еще есть больше потоков NIO.
Как я знаю, Undertow NIO-thread = CPU Core, поэтому должно быть как минимум4 NIO-потока в моем проекте spring-webflux.