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

Nats\Exception: Subscription not found #108

Open
apocello2008 opened this issue Jul 19, 2017 · 2 comments
Open

Nats\Exception: Subscription not found #108

apocello2008 opened this issue Jul 19, 2017 · 2 comments
Assignees

Comments

@apocello2008
Copy link

apocello2008 commented Jul 19, 2017

Hello. I have some troubles with messages. After ~19 000 messages per second my worker is down with error:

Nats\Exception: Subscription not found: 0c6e8d428d94756d16b1a290a5f385bf in /home/vfeuerbach/v2/tmp/coordinator/vendor/repejota/nats/src/Nats/Exception.php:48
Stack trace:
#0 /home/vfeuerbach/v2/tmp/coordinator/vendor/repejota/nats/src/Nats/Connection.php(420): Nats\Exception::forSubscriptionNotFound('0c6e8d428d94756...')
#1 /home/vfeuerbach/v2/tmp/coordinator/vendor/repejota/nats/src/Nats/Connection.php(603): Nats\Connection->handleMSG('MSG _INBOX.596f...')
#2 /home/vfeuerbach/v2/tmp/coordinator/vendor/repejota/nats/src/Nats/Connection.php(497): Nats\Connection->wait(1)
#3 /home/vfeuerbach/v2/tmp/coordinator/run.php(68): Nats\Connection->request('queue', '{"corid":"djhfj...', Object(Closure))

And another strange thing.. If i make requests like in example i have 40-50ms lat. But if i make unsubscribe lat. is 1-5ms. Example here:

Here: 50ms. lat.

 $conn->request('queue', $msg, function ($response) {
// Processing...
});

Here: 5ms. lat.

 $conn->request('queue', $msg, function ($response) {
// Processing...
});
$conn->unsubscribe('queue');

Update: I make little load testing via ab (ApacheBench). I set params -n 2 and -c 2 (two requests in one time). And i have error:
Nats\Exception: Subscription not found: 546862e7d4954cb50a1a373fd3a2e5a2

@repejota
Copy link
Owner

That's interesting!
Taking a look 💪

@repejota repejota self-assigned this Jul 19, 2017
@apocello2008
Copy link
Author

apocello2008 commented Jul 20, 2017

Thans for your answer and time, i have a little data trace for you:

Here is responce data:

string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3867}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3867}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3868}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3867}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3868}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3867}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3869}}"
string(101) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.387}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3871}}"
string(102) "{"type":"pong","status":20MSG _INBOX.5970418d5e883 84496f6969eb9a2e670752ce0f5bcfc1 102
{"type":"pong"

As you can see, PHP parse response incorrected.

Here second dump:

string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3877}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3877}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3887}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3887}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3888}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3888}}"
string(102) "{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3889}}"
string(102) "{"type":"pong","status":2070418d5ef56 76dad8a9ec8321ca2526d27705d44263 102
{"type":"pong","status":20"

And response damaged again :(

Update:

{"type":"pong","status":200,"message":{"instance":"office_local","process_timestamp":1500529037.3867}}

This string is my test response data. Not part of NATS protocol :)

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

2 participants