Skip to content

Commit f995ed4

Browse files
committed
Merges changes from master
2 parents a1425f7 + 4ab0306 commit f995ed4

File tree

116 files changed

+2890
-825
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2890
-825
lines changed

.travis.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ branches:
1111
- master
1212

1313
install:
14-
- wget --no-check-certificate https://www.cmake.org/files/v3.2/cmake-3.2.3-Linux-x86_64.sh
15-
- sudo sh cmake-3.2.3-Linux-x86_64.sh --skip-license --prefix=/usr
14+
# wget --no-check-certificate https://www.cmake.org/files/v3.2/cmake-3.2.3-Linux-x86_64.sh
15+
# sudo sh cmake-3.2.3-Linux-x86_64.sh --skip-license --prefix=/usr
1616
- sudo apt-get update
1717
- sudo apt-get install -y libtommath0 libtommath-dev
18-
- sudo python -m pip install Mako fdb
19-
- svn co http://svn.code.sf.net/p/firebird/code/qa/fbtest/trunk/ fbtest
20-
- svn co http://svn.code.sf.net/p/firebird/code/qa/fbt-repository/trunk/ fbtest/fbt
18+
# sudo python -m pip install Mako fdb
19+
# svn co http://svn.code.sf.net/p/firebird/code/qa/fbtest/trunk/ fbtest
20+
# svn co http://svn.code.sf.net/p/firebird/code/qa/fbt-repository/trunk/ fbtest/fbt
2121

2222
script:
23-
- ./autogen.sh
24-
- make -j2
25-
- sudo echo `pwd`/gen/Release/firebird/lib | sudo tee --append /etc/ld.so.conf
26-
- sudo ldconfig
27-
- sudo ./gen/Release/firebird/bin/gsec -add sysdba -pw masterkey
28-
- chmod 777 travis.sh
29-
- sudo ./travis.sh start_server &
30-
- ./travis.sh dummy_output &
31-
- ./travis.sh skip_tests
32-
- sleep 3
33-
- cd fbtest/fbt
34-
- python ../fbtest.py -d `pwd`/tmp -b `pwd`/../../gen/Release/firebird/bin -v -x -k ../../skip.txt
23+
- ./autogen.sh --enable-binreloc --prefix=/opt/firebird
24+
- make -j4
25+
- make dist
26+
- tar xzvf gen/Firebird-[0-9]*.tar.gz
27+
- (cd Firebird-[0-9]*; sudo ./install.sh -silent)
28+
- sudo usermod -a -G firebird travis
29+
# sg firebird -c "/opt/firebird/bin/gsec -user sysdba -add sysdba -pw masterkey"
30+
# ./travis.sh dummy_output &
31+
# ./travis.sh skip_tests
32+
# sleep 3
33+
# cd fbtest/fbt
34+
# sg firebird -c "python ../fbtest.py -d `pwd`/tmp -b /opt/firebird/bin -v -x -k ../../skip.txt"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Build Status](https://travis-ci.org/FirebirdSQL/firebird.svg?branch=master)](https://travis-ci.org/FirebirdSQL/firebird)
2+
13
# Firebird README
24

35
Firebird is a relational database offering many ANSI SQL standard features that runs on Linux, Windows, MacOS and a variety of Unix platforms. Firebird offers excellent concurrency, high performance, and powerful language support for stored procedures and triggers. It has been used in production systems, under a variety of names, since 1981.

builds/install/arch-specific/linux/firebird-classic.socket.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Conflicts=firebird-superserver.service
55
[Socket]
66
ListenStream=3050
77
Accept=true
8+
MaxConnections=2048
89

910
[Install]
1011
WantedBy=sockets.target

builds/install/misc/firebird.conf.in

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@
483483
# database feature for encrypted database. In that case special care should be
484484
# taken to encrypt that key before passing it to server using callback. Make
485485
# sure your keys are well encrypted before enabling this parameter. Take into
486-
# account that with CryptSecurityDatabase=TRUE unencrypted by firebird protocol
487-
# key transfer may take place even with not encrypted security database.
486+
# account that with AllowEncryptedSecurityDatabase=TRUE unencrypted by firebird
487+
# protocol key transfer may take place even with not encrypted security database.
488488
# This feature is not supported by legacy authentication plugin - if you care
489489
# about security please never use legacy authentication.
490490
#
@@ -496,7 +496,7 @@
496496
# Please understand what are you doing before enabling this feature !!! #
497497
#########################################################################
498498
#
499-
#CryptSecurityDatabase = false
499+
#AllowEncryptedSecurityDatabase = false
500500

501501
# ----------------------------
502502
#
@@ -526,6 +526,30 @@
526526
#DeadlockTimeout = 10
527527

528528

529+
# ----------------------------
530+
#
531+
# Set number of seconds after which statement execution will be automatically
532+
# cancelled by the engine. Zero means no timeout is set.
533+
#
534+
# Per-database configurable.
535+
#
536+
# Type: integer
537+
#
538+
#StatementTimeout = 0
539+
540+
541+
# ----------------------------
542+
#
543+
# Set number of minutes after which idle attachment will be disconnected by the
544+
# engine. Zero means no timeout is set.
545+
#
546+
# Per-database configurable.
547+
#
548+
# Type: integer
549+
#
550+
#ConnectionIdleTimeout = 0
551+
552+
529553
# ----------------------------
530554
#
531555
# How often the pages are flushed on disk

builds/make.new/config/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
config.guess
2-
config.h.in
2+
config.h.in*
33
config.sub
44
ltmain.sh

builds/posix/firebird.vers

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ fb_get_database_handle
347347
fb_get_transaction_handle
348348

349349
fb_database_crypt_callback
350+
fb_dsql_set_timeout
350351

351352
# Other misc functions
352353

builds/win32/defs/firebird.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ EXPORTS
222222
isc_dsql_release @199
223223
isc_dsql_set_cursor_name @200
224224
isc_dsql_sql_info @201
225+
fb_dsql_set_timeout
225226

226227
; ESQL functions
227228

doc/README.session_idle_timeouts

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
Timeouts for idle database sessions.
2+
3+
Author:
4+
Vlad Khorsun <[email protected]>
5+
6+
7+
Description:
8+
9+
The feature allows to automatically close user connection after period of inactivity.
10+
It could be used by database administrators to forcibly close old inactive connections
11+
and free resources it occupies. Application and tools developers also could find it as
12+
easy replacement of self-made control for the connection life time.
13+
It is recommended (but not required) to set idle timeout to reasonable big value, such
14+
as few hours. By default it is not enabled.
15+
16+
The feature works as below
17+
- when user API call leaves engine, special idle timer assotiated with current connection
18+
is started
19+
- when user API call enters engine, idle timer is stopped
20+
- when idle time is fired engine immediately closes the connection in the same way as
21+
with asyncronous connection cancellation:
22+
- all active statements and cursors are closed
23+
- all active transactions are rolled back
24+
- network connection is not closed at this moment. It allows client application to get
25+
exact error code on next API call. Network connection will be closed by the server
26+
side after error is reported or due to network timeout if client side disconnects.
27+
- idle session timeout could be set:
28+
- at database level, by setting value in firebird.conf (or databases.conf) by database
29+
administrator
30+
scope - all user connections, except of system connections (garbage collector, cache
31+
writer, etc)
32+
units - minutes
33+
- at connection level, using API and\or new SQL statement (see below)
34+
scope - given connection
35+
units - up to seconds
36+
- effective value of idle timeout is evaluated every time user API call leaves the engine
37+
as:
38+
- if not set at connection level, look at database level
39+
- in any case can't be greater than value set at database level
40+
i.e. value of idle timeout could be overriden by application developer at given
41+
connection but it can't relax limit set by DBA (in config)
42+
- zero timeout means no timeout, i.e. idle timer will not start
43+
- while idle timeout is set in seconds at API level, we can't promise absolute precision.
44+
With high load it could be less precise. The only guarantee is that timeout will not
45+
fire before specified moment.
46+
- if connection was cancelled, next user API call returns error isc_att_shutdown with
47+
secondary error code specifying exact reason:
48+
isc_att_shut_killed: Killed by database administrator
49+
isc_att_shut_idle: Idle timeout expired
50+
isc_att_shut_db_down: Database is shutdown
51+
isc_att_shut_engine: Engine is shutdown
52+
53+
54+
Support at configuration level (firebird.conf and\or databases.conf)
55+
56+
New setting "ConnectionIdleTimeout": set number of minutes after which idle connection
57+
will be disconnected by the engine. Zero means no timeout is set.
58+
Per-database configurable. Type: integer. Default value is 0.
59+
60+
61+
Support at API level
62+
63+
- get\set idle connection timeout, seconds
64+
interface Attachment
65+
uint getIdleTimeout(Status status);
66+
void setIdleTimeout(Status status, uint timeOut);
67+
68+
- get idle connection timeout at config and\or connection level is possible
69+
using isc_database_info() API with new info tags:
70+
- fb_info_ses_idle_timeout_db value set at config level
71+
- fb_info_ses_idle_timeout_att value set at given connection level
72+
- fb_info_ses_idle_timeout_run actual timeout value for given connection
73+
evaluated considering values set at config and
74+
connection levels, see "effective value of idle
75+
timeout" above
76+
77+
Remote client implementation notes:
78+
- Attachment::setIdleTimeout() issued "SET SESSION IDLE TIMEOUT" SQL statement
79+
- Attachment::getIdleTimeout() calls isc_database_info() with
80+
fb_info_ses_idle_timeout_att tag
81+
82+
If remote server doesn't support idle connection timeouts (protocol version less than 16):
83+
- Attachment::setIdleTimeout() will return isc_wish_list error
84+
- Attachment::getIdleTimeout() will return zero and set isc_wish_list error
85+
- isc_database_info() will return isc_info_error tag in info buffer (as usual).
86+
87+
88+
Support in SQL
89+
90+
- New SQL statement allows to set idle connection timeout at connection level:
91+
92+
SET SESSION IDLE TIMEOUT <value> [HOUR | MINUTE | SECOND]
93+
94+
if timepart is not set, default is MINUTE.
95+
This statement could run outside of transaction control and immediately effective.
96+
97+
- Context variables
98+
99+
Context 'SYSTEM' have new variable: 'SESSION_IDLE_TIMEOUT'. It contains current value
100+
of idle connection timeout that was set at connection level, or zero, if timeout was not
101+
set.
102+
103+
- Monitoring tables
104+
105+
MON$ATTACHMENTS
106+
MON$IDLE_TIMEOUT Connection level idle timeout
107+
MON$IDLE_TIMER Idle timer expiration time
108+
109+
MON$IDLE_TIMEOUT contains timeout value set at connection level, in seconds. Zero, if
110+
timeout is not set.
111+
112+
MON$IDLE_TIMER contains NULL value if idle timeout was not set or if timer is not
113+
running.

0 commit comments

Comments
 (0)