Skip to content

Connector doesn't close connections when greeting fails #379

@ArtDu

Description

@ArtDu

Коллеги, привет!
Похоже, наблюдаем баг в JavaSDK (cartridge-driver 0.10.1). Сценарий: Создаем клиента, указывая заведомо неверный пароль. На созданном клиенте при попытке доступа получаем исключение, но параллельно видим в netstat, что приложение начинает один за одним бесконечно создавать коннекты и все они остаются не закрытыми.

Создание клиента:
TarantoolClient<TarantoolTuple, TarantoolResult> client = TarantoolClientFactory.createClient()
.withAddresses(tntProperties.getNodes().stream()
.map(node -> new TarantoolServerAddress(node.getHost(), node.getPort()))
.collect(Collectors.toList()))
.withCredentials(tntProperties.getUser(), tntProperties.getPassword())
.withConnectTimeout(connectTimeoutMs)
.withRequestTimeout(requestTimeoutMs)
.withConnectionSelectionStrategy(TarantoolConnectionSelectionStrategyType.PARALLEL_ROUND_ROBIN)
.withProxyMethodMapping()
.build();

В логе приложения видим такое:
message: User not found or supplied credentials are invalid
15:35:19.441 WARN (TarantoolConnectionFactory.java:100) [i.t.d.c.c.TarantoolConnectionFactory] : Connection failed: io.tarantool.driver.exceptions.TarantoolInternalException: InnerErrorMessage:
code: 47
message: User not found or supplied credentials are invalid
15:35:20.453 WARN (TarantoolConnectionFactory.java:100) [i.t.d.c.c.TarantoolConnectionFactory] : Connection failed: io.tarantool.driver.exceptions.TarantoolInternalException: InnerErrorMessage:
code: 47
...

Если на машине с клиентом посмотреть соединения, то видим такое (и количество соединений каждую минуту растет):
netstat -na | Select-String "3311"
TCP ...:65179 ...:3311 ESTABLISHED
TCP ..
.
:65180 ...:3311 ESTABLISHED
TCP ..
.
:65181 ...:3311 ESTABLISHED
TCP ..
.
:65193 ...:3311 ESTABLISHED
TCP ..
.
:65202 ...:3311 ESTABLISHED
TCP ..
.
:65203 ...:3311 ESTABLISHED
TCP ..
.
:65204 ...:3311 ESTABLISHED
TCP ..
.
:65205 ...:3311 ESTABLISHED
TCP ..
.
:65206 ...:3311 ESTABLISHED
TCP ..
.
:65208 ...:3311 ESTABLISHED
TCP ..
.
:65209 ...:3311 ESTABLISHED
TCP ..
.
:65210 ...:3311 ESTABLISHED
TCP ..
.
:65211 ...**:3311 ESTABLISHED
...

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions