I'm currently having a problem with post-review where it hangs waiting on a
response from a reviewboard json request.

The code where it hangs is in http_post method.

 r = urllib2.Request(url, body, headers)
 data = urllib2.urlopen(r).read()                 # <--- hangs here

I'm using reviewboard 1.0 and the post-review script from
RBTools-0.2beta1-py2.5.egg

I've applied a patch against post-review to solve some bugs I encountered
(which is attached).

I'm running/debugging post-review and reviewboard on the same machine which
is a Windows server.

Any hints on why this would be the case would be helpful.

Debug output:

Y:\Order_Management_Products_VOB\TraderWorkstationMS\Dev>d:\rb\post-review.py
-d --summary="Test summary" --description="Test desc" update_paraffin.cmd
>>> cleartool pwv -short
>>> repository info: Path: Y:\, Base path: Y:\, Supports changesets: False
>>> cleartool desc -pre
Y:\Order_Management_Products_VOB\TraderWorkstationMS\Dev\update_paraffin.cmd
>>> cleartool desc -fmt %Vn Y:\
>>> cleartool desc -fmt %Vn Y:\Order_Management_Products_VOB
>>> cleartool desc -fmt %Vn
Y:\Order_Management_Products_VOB\TraderWorkstationMS
>>> cleartool desc -fmt %Vn
Y:\Order_Management_Products_VOB\TraderWorkstationMS\Dev
>>> cleartool desc -fmt %Vn Y:\
>>> cleartool desc -fmt %Vn Y:\Order_Management_Products_VOB
>>> cleartool desc -fmt %Vn
Y:\Order_Management_Products_VOB\TraderWorkstationMS
>>> cleartool desc -fmt %Vn
Y:\Order_Management_Products_VOB\TraderWorkstationMS\Dev
>>> Looking for 'mdsbu01.fw.gsjbw.com /reviewboard/' cookie in
C:\WINNT\Profiles\bldjb001\Local Settings\Application
Data\.post-review-cookies.txt
>>> Loaded valid cookie -- no login required
>>> Attempting to create review request for None
>>> HTTP POSTing to
http://mdsbu01.fw.gsjbw.com/reviewboard/api/json/reviewrequests/new/:
{'repository_path': 'Y:\\'}
>>> url:
http://mdsbu01.fw.gsjbw.com/reviewboard/api/json/reviewrequests/new/
>>> body: --172.18.240.42.1.3628.1247633073.176.1
Content-Disposition: form-data; name="repository_path"
Y:\
--172.18.240.42.1.3628.1247633073.176.1--

>>> body: {'Content-Length': '149', 'Content-Type': 'multipart/form-data;
boundary=172.18.240.42.1.3628.1247633073.176.1'}
>>> Review request created
>>> Attempting to set field 'summary' to 'Test summary' for review request
'10'
>>> HTTP POSTing to
http://mdsbu01.fw.gsjbw.com/reviewboard/api/json/reviewrequests/10/draft/set/:
{'summary': 'Test summary'}
>>> url:
http://mdsbu01.fw.gsjbw.com/reviewboard/api/json/reviewrequests/10/draft/set/
>>> body: --172.18.240.42.1.3628.1247633073.223.2
Content-Disposition: form-data; name="summary"
Test summary
--172.18.240.42.1.3628.1247633073.223.2--

>>> body: {'Content-Length': '150', 'Content-Type': 'multipart/form-data;
boundary=172.18.240.42.1.3628.1247633073.223.2'}
>>> Attempting to set field 'description' to 'VIEW: bldjb001_view3
VIEWTYPE: dynamic
Test desc' for review request '10'
>>> HTTP POSTing to
http://mdsbu01.fw.gsjbw.com/reviewboard/api/json/reviewrequests/10/draft/set/:
{'description': 'VIEW: bldjb001_view3\nVIEWTYPE: dynamic\nTest desc'}
>>> url:
http://mdsbu01.fw.gsjbw.com/reviewboard/api/json/reviewrequests/10/draft/set/
>>> body: --172.18.240.42.1.3628.1247633073.301.3
Content-Disposition: form-data; name="description"
VIEW: bldjb001_view3
VIEWTYPE: dynamic
Test desc
--172.18.240.42.1.3628.1247633073.301.3--

>>> body: {'Content-Length': '190', 'Content-Type': 'multipart/form-data;
boundary=172.18.240.42.1.3628.1247633073.301.3'}
>>> HTTP POSTing to
http://mdsbu01.fw.gsjbw.com/reviewboard/api/json/reviewrequests/10/draft/save/:
{}
>>> url:
http://mdsbu01.fw.gsjbw.com/reviewboard/api/json/reviewrequests/10/draft/save/
>>> body: --172.18.240.42.1.3628.1247633073.363.4--

>>> body: {'Content-Length': '45', 'Content-Type': 'multipart/form-data;
boundary=172.18.240.42.1.3628.1247633073.363.4'}
>>> Review request draft saved
>>> Uploading diff, size: 481
>>> HTTP POSTing to
http://mdsbu01.fw.gsjbw.com/reviewboard/api/json/reviewrequests/10/diff/new/:
{'basedir': 'Y:\\'}
>>> url:
http://mdsbu01.fw.gsjbw.com/reviewboard/api/json/reviewrequests/10/diff/new/
>>> body: --172.18.240.42.1.3628.1247633073.426.5
Content-Disposition: form-data; name="basedir"
Y:\
--172.18.240.42.1.3628.1247633073.426.5
Content-Disposition: form-data; name="path"; filename="diff"
---
Y:\Order_Management_Products_VOB\@@\main\79\TraderWorkstationMS\@@\main\3\Dev\@@\main\25\update_paraffin.cmd\@@\main\0
2002-02-21 23:30:39.942229878 -0800
+++
Y:\Order_Management_Products_VOB\@@\main\79\TraderWorkstationMS\@@\main\3\Dev\@@\main\25\update_paraffin.cmd\@@\main\1
2002-02-21 23:30:50.442260588 -0800
@@ -1,0 +1,8 @@
+...@echo off
+pushd OrderManagement
+call run_build.cmd update-paraffin
+popd
+
+pushd TraderCentre
+call run_build.cmd update-paraffin
+popd
--172.18.240.42.1.3628.1247633073.426.5--

>>> body: {'Content-Length': '729', 'Content-Type': 'multipart/form-data;
boundary=172.18.240.42.1.3628.1247633073.426.5'}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~----------~----~----~----~------~----~------~--~---

--- post-review.orig    2009-03-29 01:58:12.000000000 +1100
+++ post-review.py      2009-07-15 14:44:29.926389000 +1000
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+import stat
 import cookielib
 import difflib
 import getpass
@@ -547,6 +548,11 @@
 
         try:
             r = urllib2.Request(url, body, headers)
+
+            debug("url: %s" % (url))
+            debug("body: %s" % (body))
+            debug("body: %s" % (headers))
+            
             data = urllib2.urlopen(r).read()
             self.cookie_jar.save(self.cookie_file)
             return data
@@ -730,7 +736,7 @@
     information and generates compatible diffs.
     This client assumes that cygwin is installed on windows.
     """
-    ccroot_path = "/view/reviewboard.diffview/vobs/"
+    ccroot_path = "Y:\\"
     viewinfo = ""
     viewtype = "snapshot"
 
@@ -778,7 +784,7 @@
             # Call cleartool to get this version and the previous version
             #   of the element.
             curr_version, pre_version = execute(
-                ["cleartool", "desc", "-pre", elem_path])
+                ["cleartool", "desc", "-pre", elem_path], split_lines=True)
             curr_version = cpath.normpath(curr_version)
             pre_version = pre_version.split(':')[1].strip()
 
@@ -824,7 +830,7 @@
                     #   so split the path and concat the file name
                     #   and version in the last position of the list.
                     ver = fpath.split("@@")
-                    splversions = fpath[:vkey.rfind("@@")].split("\\")
+                    splversions = fpath[:fpath.rfind("@@")].split("\\")
                     fname = splversions.pop()
                     splversions.append(fname + ver[1])
                 else :
@@ -859,7 +865,7 @@
                 #   the version on the command line.
                 ext_path.append(cpath.normpath(fname + "/@@" +
                     vkey[vkey.rfind("@@")+2:len(vkey)]))
-                epstr = cpath.join(bpath, cpath.normpath(''.join(ext_path)))
+                epstr = cpath.join(bpath, 
cpath.normpath(''.join(ext_path))).strip("\n")
                 evfiles.append(epstr)
 
                 """
@@ -896,8 +902,9 @@
                         tf = cpath.normpath(cpath.join(td, name))
                         if cpath.exists(tf):
                             debug("WARNING: FILE EXISTS")
-                            os.unlink(tf)
-                        execute(["cleartool", "get", "-to", tf, normkey])
+                            os.chmod(tf, stat.S_IWRITE | stat.S_IREAD)
+                            os.remove(tf)
+                        execute(["cleartool", "get", "-to", tf, 
normkey.strip("\n")])
                     else:
                         die("ERROR: FILE NOT FOUND : %s" % epstr)
 
@@ -986,12 +993,13 @@
                     fn = self.get_filename_hash(filenam)
                     fn = cpath.join(tempfile.gettempdir(), fn)
                     do_rem = True
-                fd = open(cpath.normpath(fn))
+                fd = open(cpath.normpath(fn), 'r')
                 fdata = fd.readlines()
                 fd.close()
                 file_data.append(fdata)
                 # If the file was temp, it should be removed.
                 if do_rem:
+                   os.chmod(fn, stat.S_IWRITE | stat.S_IREAD)
                     os.remove(filenam)
 
             modi = file_data.pop()

Reply via email to