Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
4af38cc6
Commit
4af38cc6
authored
13 years ago
by
Olivier Dony
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] attempt to dump uid performing operation along with thread stacks
bzr revid: odo@openerp.com-20120316111218-o963t7xm4r4honoy
parent
d893cb3e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
openerp-server
+8
-3
8 additions, 3 deletions
openerp-server
openerp/netsvc.py
+2
-0
2 additions, 0 deletions
openerp/netsvc.py
openerp/service/web_services.py
+3
-0
3 additions, 0 deletions
openerp/service/web_services.py
with
13 additions
and
3 deletions
openerp-server
+
8
−
3
View file @
4af38cc6
...
...
@@ -165,11 +165,16 @@ def dumpstacks(sig, frame):
"""
Signal handler: dump a stack trace for each existing thread.
"""
# code from http://stackoverflow.com/questions/132058/getting-stack-trace-from-a-running-python-application#answer-2569696
# modified for python 2.5 compatibility
thread_map
=
dict
(
threading
.
_active
,
**
threading
.
_limbo
)
id2name
=
dict
([(
threadId
,
thread
.
getName
())
for
threadId
,
thread
in
thread_map
.
items
()])
threads_info
=
dict
([(
th
.
ident
,
{
'
name
'
:
th
.
name
,
'
uid
'
:
getattr
(
th
,
'
uid
'
,
'
n/a
'
)})
for
th
in
threading
.
enumerate
()])
code
=
[]
for
threadId
,
stack
in
sys
.
_current_frames
().
items
():
code
.
append
(
"
\n
# Thread: %s(%d)
"
%
(
id2name
.
get
(
threadId
,
'
n/a
'
),
threadId
))
thread_info
=
threads_info
.
get
(
threadId
)
code
.
append
(
"
\n
# Thread: %s (id:%s) (uid:%s)
"
%
\
(
thread_info
and
thread_info
[
'
name
'
]
or
'
n/a
'
,
threadId
,
thread_info
and
thread_info
[
'
uid
'
]
or
'
n/a
'
))
for
filename
,
lineno
,
name
,
line
in
traceback
.
extract_stack
(
stack
):
code
.
append
(
'
File:
"
%s
"
, line %d, in %s
'
%
(
filename
,
lineno
,
name
))
if
line
:
...
...
This diff is collapsed.
Click to expand it.
openerp/netsvc.py
+
2
−
0
View file @
4af38cc6
...
...
@@ -357,6 +357,8 @@ def dispatch_rpc(service_name, method, params):
if
rpc_request
and
rpc_response_flag
:
log
(
rpc_request
,
logging
.
DEBUG
,
'
%s.%s
'
%
(
service_name
,
method
),
replace_request_password
(
params
))
threading
.
current_thread
().
uid
=
None
threading
.
current_thread
().
dbname
=
None
result
=
ExportService
.
getService
(
service_name
).
dispatch
(
method
,
params
)
if
rpc_request_flag
or
rpc_response_flag
:
...
...
This diff is collapsed.
Click to expand it.
openerp/service/web_services.py
+
3
−
0
View file @
4af38cc6
...
...
@@ -561,6 +561,7 @@ class objects_proxy(netsvc.ExportService):
def
dispatch
(
self
,
method
,
params
):
(
db
,
uid
,
passwd
)
=
params
[
0
:
3
]
threading
.
current_thread
().
uid
=
uid
params
=
params
[
3
:]
if
method
==
'
obj_list
'
:
raise
NameError
(
"
obj_list has been discontinued via RPC as of 6.0, please query ir.model directly!
"
)
...
...
@@ -594,6 +595,7 @@ class wizard(netsvc.ExportService):
def
dispatch
(
self
,
method
,
params
):
(
db
,
uid
,
passwd
)
=
params
[
0
:
3
]
threading
.
current_thread
().
uid
=
uid
params
=
params
[
3
:]
if
method
not
in
[
'
execute
'
,
'
create
'
]:
raise
KeyError
(
"
Method not supported %s
"
%
method
)
...
...
@@ -645,6 +647,7 @@ class report_spool(netsvc.ExportService):
def
dispatch
(
self
,
method
,
params
):
(
db
,
uid
,
passwd
)
=
params
[
0
:
3
]
threading
.
current_thread
().
uid
=
uid
params
=
params
[
3
:]
if
method
not
in
[
'
report
'
,
'
report_get
'
,
'
render_report
'
]:
raise
KeyError
(
"
Method not supported %s
"
%
method
)
...
...
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