Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
4d5e3624
Commit
4d5e3624
authored
Jun 11, 2014
by
Byron Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 962424: jobqueue's worker process should process messages in batches
r=?,a=?
parent
617eeba5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
JobQueue.pm
Bugzilla/JobQueue.pm
+14
-0
jobqueue.pl
jobqueue.pl
+1
-1
011pod.t
t/011pod.t
+1
-1
No files found.
Bugzilla/JobQueue.pm
View file @
4d5e3624
...
...
@@ -30,6 +30,10 @@ use constant JOB_MAP => {
# across requests.
use
constant
DRIVER_CACHE_TIME
=>
300
;
# 5 minutes
# To avoid memory leak/fragmentation, a worker process won't process more than
# MAX_MESSAGES messages.
use
constant
MAX_MESSAGES
=>
1000
;
sub
job_map
{
if
(
!
defined
(
Bugzilla
->
request_cache
->
{
job_map
}))
{
my
$job_map
=
JOB_MAP
;
...
...
@@ -155,6 +159,16 @@ sub work_once {
return
$self
->
SUPER::
work_once
(
@_
);
}
# Never process more than MAX_MESSAGES in one batch, to avoid memory
# leak/fragmentation issues.
sub
work_until_done
{
my
$self
=
shift
;
my
$count
=
0
;
while
(
$count
++
<
MAX_MESSAGES
)
{
$self
->
work_once
or
last
;
}
}
1
;
__END__
...
...
jobqueue.pl
View file @
4d5e3624
...
...
@@ -45,7 +45,7 @@ jobqueue.pl - Runs jobs in the background for Bugzilla.
restart
Stops
a
running
jobqueue
if
one
is
running
,
and
then
starts
a
new
one
.
once
Checks
the
job
queue
once
,
executes
the
first
item
found
(
if
any
)
and
then
exits
any
,
up
to
a
limit
of
1000
items
)
and
then
exits
onepass
Checks
the
job
queue
,
executes
all
items
found
,
and
then
exits
check
Report
the
current
status
of
the
daemon
.
install
On
some
*
nix
systems
,
this
automatically
installs
and
...
...
t/011pod.t
View file @
4d5e3624
...
...
@@ -30,7 +30,7 @@ use constant DEFAULT_WHITELIST => qr/^(?:new|new_from_list|check|run_create_vali
use constant SUB_WHITELIST => (
'Bugzilla::Flag' => qr/^(?:(force_)?retarget|force_cleanup)$/,
'Bugzilla::FlagType' => qr/^sqlify_criteria$/,
'Bugzilla::JobQueue' => qr/(?:^work_once|subprocess_worker)$/,
'Bugzilla::JobQueue' => qr/(?:^work_once|
work_until_done|
subprocess_worker)$/,
'Bugzilla::Search' => qr/^SPECIAL_PARSING$/,
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment