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

Auto Eject Host down from pool connections. #272

Closed
BruAPAHE opened this issue Mar 13, 2023 · 6 comments · Fixed by #274
Closed

Auto Eject Host down from pool connections. #272

BruAPAHE opened this issue Mar 13, 2023 · 6 comments · Fixed by #274
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@BruAPAHE
Copy link

Привет, извини, что на русском. Не подскажешь есть ли механизм убирания упавшего тарантула из пула коннектов. Не могу найти в библиотеке. Пакет connection_pool. Нашел Deactivated(conn *tarantool.Connection, role Role) error
но нет примеров как использовать.

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Mar 13, 2023

Добрый день. Совсем убрать на данный момент нельзя.

При падении тарантула пул это должен определить с некоторой задержкой и убрать его из списка активных соединений. Но подключаться к этому хосту он по-прежнему будет пытаться. А после успешного подключения - слать запросы.

Можно с помощью Discovered мешать добавлению повторного подключения в список активных соединений, но звучит это как костыль с неясной мотивацией:

https://pkg.go.dev/github.com/tarantool/go-tarantool@v1.10.0/connection_pool#Connect
https://pkg.go.dev/github.com/tarantool/go-tarantool@v1.10.0/connection_pool#OptsPool
https://pkg.go.dev/github.com/tarantool/go-tarantool@v1.10.0/connection_pool#ConnectionHandler

@oleg-jukovec oleg-jukovec added the question Further information is requested label Mar 13, 2023
@BruAPAHE
Copy link
Author

BruAPAHE commented Mar 13, 2023

@oleg-jukovec Почему то не работает чекер, поставил на 1 секунду. Запросы все равно летят в недоступный контейнер.

connect, err := connection_pool.Connect([]string{"0.0.0.0:3302", "0.0.0.0:3303"}, tnt.Opts{
User: "guest",
Timeout: 6 * time.Second,
Reconnect: 10 * time.Second,
})
if err != nil {
log.Fatalln(err)
}

for {
	var result any
	log.Println(connect.GetTyped("tester2", "primary", tnt.IntKey{I: 1}, &result, connection_pool.ANY))
	log.Println(result)
	time.Sleep(1 * time.Second)
}

2023/03/13 14:26:53
2023/03/13 14:26:53 [1 Roxette 1986]
2023/03/13 14:26:54 client connection is not ready (0x4000)
2023/03/13 14:26:54
2023/03/13 14:26:55
2023/03/13 14:26:55 [1 Roxette 1986]
2023/03/13 14:26:56 client connection is not ready (0x4000)
2023/03/13 14:26:56
2023/03/13 14:26:57
2023/03/13 14:26:57 [1 Roxette 1986]
2023/03/13 14:26:57 tarantool: reconnect (7/0) to 0.0.0.0:3302 failed: dial tcp 0.0.0.0:3302: connect: connection refused
2023/03/13 14:26:58 client connection is not ready (0x4000)
2023/03/13 14:26:58

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Mar 13, 2023

Попробуйте убрать из опций Reconnect: 10 * time.Second, если сработает то это бажок: видимо где-то неправильно обрабатываем состояние соединения в reconnect'е.

@oleg-jukovec oleg-jukovec added bug Something isn't working 1sp and removed question Further information is requested labels Mar 13, 2023
@BruAPAHE
Copy link
Author

@oleg-jukovec помогло, спасибо!

@BruAPAHE
Copy link
Author

close

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Mar 13, 2023

Нужно будет посмотреть проблему внимательней. Хоть и не критично, но неприятно.

@oleg-jukovec oleg-jukovec reopened this Mar 13, 2023
@oleg-jukovec oleg-jukovec added good first issue Good for newcomers teamE labels Mar 13, 2023
@oleg-jukovec oleg-jukovec self-assigned this Mar 15, 2023
oleg-jukovec added a commit that referenced this issue Mar 15, 2023
The ConnectionPool didn't close a connection if it couldn't get
the conenction a role on update state check.

Closes #272
oleg-jukovec added a commit that referenced this issue Mar 15, 2023
The ConnectionPool didn't close a connection if it couldn't get
a role when checking the connection.

Closes #272
oleg-jukovec added a commit that referenced this issue Mar 15, 2023
The ConnectionPool didn't close a connection if it couldn't get
a role when checking the connection.

Closes #272
oleg-jukovec added a commit that referenced this issue Mar 24, 2023
Overview

    The release adds pagination support and wrappers for for the
    crud module.

Breaking changes

    There are no breaking changes in the release.

New features

    Support pagination (#246).

    A Makefile target to test with race detector (#218).

    Support CRUD API (#108).

    An ability to replace a base network connection to a Tarantool
    instance (#265).

Bugfixes

    Several non-critical data race issues (#218).

    ConnectionPool does not properly handle disconnection with
    Opts.Reconnect set (#272).
oleg-jukovec added a commit that referenced this issue Mar 24, 2023
Overview

    The release adds pagination support and wrappers for the
    crud module.

Breaking changes

    There are no breaking changes in the release.

New features

    Support pagination (#246).

    A Makefile target to test with race detector (#218).

    Support CRUD API (#108).

    An ability to replace a base network connection to a Tarantool
    instance (#265).

Bugfixes

    Several non-critical data race issues (#218).

    ConnectionPool does not properly handle disconnection with
    Opts.Reconnect set (#272).
oleg-jukovec added a commit that referenced this issue Mar 24, 2023
Overview

    The release adds pagination support and wrappers for the
    crud module.

Breaking changes

    There are no breaking changes in the release.

New features

    Support pagination (#246).

    A Makefile target to test with race detector (#218).

    Support CRUD API (#108).

    An ability to replace a base network connection to a Tarantool
    instance (#265).

Bugfixes

    Several non-critical data race issues (#218).

    Build on Apple M1 with OpenSSL (#260).

    ConnectionPool does not properly handle disconnection with
    Opts.Reconnect set (#272).
oleg-jukovec added a commit that referenced this issue Apr 27, 2023
Overview

    The release adds pagination support and wrappers for the
    crud module.

Breaking changes

    There are no breaking changes in the release.

New features

    Support pagination (#246).

    A Makefile target to test with race detector (#218).

    Support CRUD API (#108).

    An ability to replace a base network connection to a Tarantool
    instance (#265).

    Missed iterator constant (#285).

Bugfixes

    Several non-critical data race issues (#218).

    Build on Apple M1 with OpenSSL (#260).

    ConnectionPool does not properly handle disconnection with
    Opts.Reconnect set (#272).
oleg-jukovec added a commit that referenced this issue May 18, 2023
Overview

    The release adds pagination support and wrappers for the
    crud module.

Breaking changes

    There are no breaking changes in the release.

New features

    Support pagination (#246).

    A Makefile target to test with race detector (#218).

    Support CRUD API (#108).

    An ability to replace a base network connection to a Tarantool
    instance (#265).

    Missed iterator constant (#285).

Bugfixes

    Several non-critical data race issues (#218).

    Build on Apple M1 with OpenSSL (#260).

    ConnectionPool does not properly handle disconnection with
    Opts.Reconnect set (#272).

    Watcher events loss with a small per-request timeout (#284).

    Connect() panics on concurrent schema update (#278).

    Wrong Ttr setup by Queue.Cfg() (#278).

    Flaky queue/Example_connectionPool (#278).

    Flaky queue/Example_simpleQueueCustomMsgPack (#277).

Other

    queue module version bumped to 1.3.0 (#278).
oleg-jukovec added a commit that referenced this issue May 18, 2023
Overview

    The release adds pagination support and wrappers for the
    crud module.

Breaking changes

    There are no breaking changes in the release.

New features

    Support pagination (#246).

    A Makefile target to test with race detector (#218).

    Support CRUD API (#108).

    An ability to replace a base network connection to a Tarantool
    instance (#265).

    Missed iterator constant (#285).

Bugfixes

    Several non-critical data race issues (#218).

    Build on Apple M1 with OpenSSL (#260).

    ConnectionPool does not properly handle disconnection with
    Opts.Reconnect set (#272).

    Watcher events loss with a small per-request timeout (#284).

    Connect() panics on concurrent schema update (#278).

    Wrong Ttr setup by Queue.Cfg() (#278).

    Flaky queue/Example_connectionPool (#278).

    Flaky queue/Example_simpleQueueCustomMsgPack (#277).

Other

    queue module version bumped to 1.3.0 (#278).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants