Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
18e61a64
Commit
18e61a64
authored
9 years ago
by
Joshua Colp
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "taskprocessor: Add high water mark warnings" into 13
parents
3e0f1617
6ff48319
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main/taskprocessor.c
+11
-0
11 additions, 0 deletions
main/taskprocessor.c
with
11 additions
and
0 deletions
main/taskprocessor.c
+
11
−
0
View file @
18e61a64
...
...
@@ -83,6 +83,8 @@ struct ast_taskprocessor {
pthread_t
thread
;
/*! Indicates if the taskprocessor is currently executing a task */
unsigned
int
executing
:
1
;
/*! Indicates that a high water warning has been issued on this task processor */
unsigned
int
high_water_warned
:
1
;
};
/*!
...
...
@@ -714,6 +716,8 @@ void *ast_taskprocessor_unreference(struct ast_taskprocessor *tps)
return
NULL
;
}
#define HIGH_WATER_LEVEL 100
/* push the task into the taskprocessor queue */
static
int
taskprocessor_push
(
struct
ast_taskprocessor
*
tps
,
struct
tps_task
*
t
)
{
...
...
@@ -733,6 +737,13 @@ static int taskprocessor_push(struct ast_taskprocessor *tps, struct tps_task *t)
ao2_lock
(
tps
);
AST_LIST_INSERT_TAIL
(
&
tps
->
tps_queue
,
t
,
list
);
previous_size
=
tps
->
tps_queue_size
++
;
if
(
previous_size
>=
HIGH_WATER_LEVEL
&&
!
tps
->
high_water_warned
)
{
ast_log
(
LOG_WARNING
,
"The '%s' task processor queue reached %d scheduled tasks.
\n
"
,
tps
->
name
,
previous_size
);
tps
->
high_water_warned
=
1
;
}
/* The currently executing task counts as still in queue */
was_empty
=
tps
->
executing
?
0
:
previous_size
==
0
;
ao2_unlock
(
tps
);
...
...
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