-
Notifications
You must be signed in to change notification settings - Fork 29
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
callback missing when use Future.wait #42
Comments
I'm not certain what causes this. Do you get any exceptions? I haven't done much with multiple requests yet, and am yet to look in to implementing MULTI. |
no exception throws. just wait there. I use MONITOR command, Seems redis has received the command. |
works for me. |
I can't use pub get after upgrade to 1.1.0-dev.5.6 at home. Thanks |
Hi I use hmget to get one field, it's OK waitList
..add(handler.hmget('u:1:1', ['a']).then((_) => print(1)))
..add(handler.hmget('u:1:2', ['a']).then((_) => print(2)))
..add(handler.hmget('u:1:3', ['a']).then((_) => print(3)))
;
But if i change to multiple fields
callback missing
|
I will have a look tomorrow. |
Thanks |
I am looking into it. But also very busy so I can't make any promises for when it will be finished. |
Not the problem, just take your time. I use dart for fun, not for work. Any clue show where the problem is? I'm not familar with redis protocol, but maybe I can help |
any progress? |
I am currently very busy as I just arrived in Shanghai for an internship, as you can see in the referenced PR I had a look today and found something that might give a clue as to what makes this bug happen (the clue being the wrong callback being fulfilled) however since I can not reproduce I am still left in the dark a bit. What I was thinking about before is making use of darts' Zone API to get a better callstack for the errors. However I have not thought for very long about different solutions, and if this will actually work for the time-outs. Question for @himulawang , can you run all_tests normally? |
Haha... What a coincidence! I am Chinese from Shanghai. But today I am leaving for Japan for a trip. Back to S.H. at 02.12. C u later. |
I can't run all_tests normally. Two questions: First, .then((String value) => expect(value, equals("16.800000000000001"))) this line causes: Uncaught Error: Expected: '16.800000000000001' Second, after I block this line, output: /home/ila/ide/dart/dart-sdk/bin/dart --ignore-unrecognized-flags --debug:52060 --package-root=/home/ila/project/redis_client/packages/ /home/ila/project/redis_client/test/all_tests.dart unittest-suite-wait-for-done just wait there. This result just like Future.wait. Callback missing. |
I'm looking into this problem. // source from redis_connection.dart
socket.transform(new StreamTransformer.fromHandlers(handleData: handleData, handleError: handleError, handleDone: handleDone))
.listen(_onRedisReply, onError: _onStreamError, onDone: _onStreamDone); I add 3 hmget requests to waitList, and handleData function is only called 2 times. Seems the response is missing in StreamTransformer. also, I find another problem. Ref: #48 |
Today I find what's really happening in this problem. When you send 2 commands in a very short time, Redis will response 2 requests with one net package. So handleData function is invoked only once. Send one command a time: void handleData(List<int> data, EventSink<RedisReply> output) {
print(data)
//[42, 50, 13, 10, 36, 45, 49, 13, 10, 36, 45, 49, 13, 10] Send two command a time: void handleData(List<int> data, EventSink<RedisReply> output) {
print(data)
//[42, 50, 13, 10, 36, 45, 49, 13, 10, 36, 45, 49, 13, 10, 42, 50, 13, 10, 36, 45, 49, 13, 10, 36, 45, 49, 13, 10] What we should do is create a buffer pool, a callback queue, every time a handleData is invoked, check the buffer pool, get first valid reply, cut it out, and get the first function from callback queue, call it with reply. We can see this as ref: |
output
callback from 3 to 5 was not called
The text was updated successfully, but these errors were encountered: