Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Barchiesi
OpenLDAP
Commits
483a7708
Commit
483a7708
authored
13 years ago
by
Howard Chu
Committed by
Quanah Gibson-Mount
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
More for ITS#6961 - deadlock checking
parent
4c8fcd5c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/back-bdb/search.c
+23
-6
23 additions, 6 deletions
servers/slapd/back-bdb/search.c
with
23 additions
and
6 deletions
servers/slapd/back-bdb/search.c
+
23
−
6
View file @
483a7708
...
...
@@ -313,7 +313,7 @@ sameido:
/* Get the next ID from the DB. Used if the candidate list is
* a range and simple iteration hits missing entryIDs
*/
static
ID
static
int
bdb_get_nextid
(
struct
bdb_info
*
bdb
,
DB_TXN
*
ltid
,
ID
*
cursor
)
{
DBC
*
curs
;
...
...
@@ -326,7 +326,7 @@ bdb_get_nextid(struct bdb_info *bdb, DB_TXN *ltid, ID *cursor)
rc
=
bdb
->
bi_id2entry
->
bdi_db
->
cursor
(
bdb
->
bi_id2entry
->
bdi_db
,
ltid
,
&
curs
,
bdb
->
bi_db_opflags
);
if
(
rc
)
return
NOID
;
return
rc
;
key
.
data
=
&
nid
;
key
.
size
=
key
.
ulen
=
sizeof
(
ID
);
key
.
flags
=
DB_DBT_USERMEM
;
...
...
@@ -335,9 +335,8 @@ bdb_get_nextid(struct bdb_info *bdb, DB_TXN *ltid, ID *cursor)
rc
=
curs
->
c_get
(
curs
,
&
key
,
&
data
,
DB_SET_RANGE
);
curs
->
c_close
(
curs
);
if
(
rc
)
return
NOID
;
return
rc
;
BDB_DISK2ID
(
&
nid
,
cursor
);
return
*
cursor
;
}
int
...
...
@@ -747,6 +746,7 @@ fetch_entry_retry:
ltid
->
flags
&=
~
TXN_DEADLOCK
;
goto
fetch_entry_retry
;
}
txnfail:
opinfo
->
boi_err
=
rs
->
sr_err
;
send_ldap_error
(
op
,
rs
,
LDAP_BUSY
,
"ldap server busy"
);
goto
done
;
...
...
@@ -775,8 +775,25 @@ fetch_entry_retry:
(
long
)
id
,
0
,
0
);
}
else
{
/* get the next ID from the DB */
id
=
bdb_get_nextid
(
bdb
,
ltid
,
&
cursor
);
cursor
=
id
-
1
;
id_retry:
rs
->
sr_err
=
bdb_get_nextid
(
bdb
,
ltid
,
&
cursor
);
if
(
rs
->
sr_err
==
DB_NOTFOUND
)
{
break
;
}
else
if
(
rs
->
sr_err
==
DB_LOCK_DEADLOCK
)
{
if
(
opinfo
)
goto
txnfail
;
ltid
->
flags
&=
~
TXN_DEADLOCK
;
goto
id_retry
;
}
else
if
(
rs
->
sr_err
==
DB_LOCK_NOTGRANTED
)
{
goto
id_retry
;
}
if
(
rs
->
sr_err
)
{
rs
->
sr_err
=
LDAP_OTHER
;
rs
->
sr_text
=
"internal error in get_nextid"
;
send_ldap_result
(
op
,
rs
);
goto
done
;
}
cursor
--
;
}
goto
loop_continue
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment