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

double semaphore locking when query the monitoring tables during long fetches [CORE1330] #1749

Closed
firebird-automations opened this issue Jun 21, 2007 · 11 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Vitaly (v6y)

Attachments:
test.mon.tgz

I wrote a programm which in infinite loop makes the following actions: queries the monitoring tables, commits transaction and sleeps for a second than repeat it again.

Very often, when this programm already being runned, if I would run at least two procceses, connected to the same database and which made a long time fetches, everything is hanging and it is impossible even to make a new connection to this database. The reason is that operation "-1" performed twice to the "monitoring" semaphore and because its value already zero when trying to perform this operation second time, "semop" system call waiting till it (semaphore) becames nonzero. So the only way to solve this problem is to use some external programm to perfom opertion "+1" or remove at all this semaphore.

May be this is the Linux-specific bug, because I failed to reproduce it when server running on Windows

I can attach test-files If needed

Commits: d8700f3

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Yes, please attach test files.
One more question - may be you have something interesting in firebird.log?

@firebird-automations
Copy link
Collaborator Author

Commented by: Vitaly (v6y)

This test for Linux only.

Unpack and run "http://prepare.sh". It should create /tmp/testdb.fdb, table test with 100000 records in it and compile three executables - monquery, query and sema
Than first run "monquery". After this, simultaniosly run at least two copies of "query" from another terminals. If you get "hanging" effect try to run "sema -s"

May be you will need to try it several times, because it can work properly for a time. The order is important: first should be "monquery," than at least two "query" with as short interval between starting as possible

"hanging" happens because of semop trying to perform "-1" operation with 0 valued semaphore, so there are no messages in fierbird.log at that time. After applying "+1" operation by means of the external programm, gettng error message "Invalid clumplet buffer structure: buffer end before end of clumplet - clumplet too long" on console and records like that in firebird.log:

vitaly-home Thu Jun 21 22:30:52 2007
Clump 8 at offset 1846: <c2><0c><00><00>

vitaly-home Thu Jun 21 22:30:52 2007
Clump 12 at offset 1855: /home/vitaly/programms/C/myibase.new/tests/test.mon/monquery

vitaly-home Thu Jun 21 22:30:52 2007
Clump 9 at offset 1920: <00><00><00><00>

vitaly-home Thu Jun 21 22:30:52 2007
Clump 10 at offset 1929: <00><d4><00><00>*<ea>R/

vitaly-home Thu Jun 21 22:30:52 2007
Clump 11 at offset 1942: <01><00><00><00>

@firebird-automations
Copy link
Collaborator Author

Modified by: Vitaly (v6y)

Attachment: test.mon.tgz [ 10420 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Confirm the bug for linux classic.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Alexander Peshkov [ alexpeshkoff ] => Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.1 Beta 2 [ 10190 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 12410 ] => Firebird [ 14888 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Cannot be tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment