Initialize the PyCrypto random number generator for each thread/process.

Review Request #7111 — Created March 24, 2015 and submitted

Information

Review Board
release-2.0.x
d0b8b3f...

Reviewers

PyCrypto requires that the random number be re-generated for every
forked process. While this should already be happening, it seems that
there are cases where it doesn't. (This may be dependent on the version
of PyCrypto.)

In order to guarantee that PyCrypto is happy, we'll initialize it during
Review Board initialization.

Unit tests pass.

Navigating around Review Board works.

I was not able to reproduce the original bug here, but this should satisfy
the requirements.

Description From Last Updated

'reviewboard' imported but unused

reviewbotreviewbot

'reviewboard' imported but unused

reviewbotreviewbot
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/__init__.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/__init__.py
    
    
  2. reviewboard/__init__.py (Diff revision 1)
     
     
    Show all issues
     'reviewboard' imported but unused
    
  3. 
      
VT
  1. 
      
  2. reviewboard/__init__.py (Diff revision 1)
     
     
    Not familiar with combining forking and test cases, but is it possible to use `forkpty()` or `fork()` and verify each process has a different random number?
    1. I'm actually going to change this to not run this when running tests, to prevent an impact on the test suite.

      Tests don't fork, though, so there's not really anything there to worry about. This is more about runtime when in certain server configurations with certain versions of dependencies.

  3. 
      
chipx86
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/__init__.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/__init__.py
    
    
  2. reviewboard/__init__.py (Diff revision 2)
     
     
    Show all issues
     'reviewboard' imported but unused
    
  3. 
      
brennie
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.5.x (47807d5)