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

"Space 'X' does not exist" exception occurs under load #69

Closed
rybakit opened this issue Oct 5, 2020 · 1 comment
Closed

"Space 'X' does not exist" exception occurs under load #69

rybakit opened this issue Oct 5, 2020 · 1 comment

Comments

@rybakit
Copy link
Member

rybakit commented Oct 5, 2020

A library user occasionally sees the "Space 'X' does not exist" exception, and this only happens under load. The configuration they use:

Client::fromOptions([
  'uri' => "tcp://{$host}:{$settings['tarantool']['port']}",
  'username' => $settings['tarantool']['username'],
  'password' => $settings['tarantool']['password'],
  'tcp_nodelay' => true,
  'persistent' => true,
  'connect_timeout' => 20,
  'socket_timeout' => 20,
])->withMiddleware(
    RetryMiddleware::linear()
);
rybakit added a commit that referenced this issue Oct 5, 2020
rybakit added a commit that referenced this issue Oct 5, 2020
rybakit added a commit that referenced this issue Oct 5, 2020
@rybakit
Copy link
Member Author

rybakit commented Oct 5, 2020

As it turned out, this exception is thrown because when the connection gets broken the RetryMiddleware attempts to reconnect and retry the last failed operation. But since the middleware is added to the end of the middleware stack, it does not reauthenticate on the newly created connection. This causes the default guest user to try to access the X space that he does not have access to.

README was updated to clarify the nuances of middleware ordering and a new Client::withPrependedMiddleware() method was added: 3f15df8.

A note for myself on how to simulate a bad connection:

sudo tc qdisc add dev eth1 root netem delay 100ms 2000ms 30%
sudo tc qdisc del dev eth1 root

@rybakit rybakit closed this as completed Oct 5, 2020
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

1 participant