Merge lp:~salgado/storm/fix-timeout-tracer into lp:storm
Status: | Merged |
---|---|
Merged at revision: | 450 |
Proposed branch: | lp:~salgado/storm/fix-timeout-tracer |
Merge into: | lp:storm |
Diff against target: |
314 lines (+165/-38) 4 files modified
storm/database.py (+32/-26) storm/tracer.py (+32/-0) tests/database.py (+20/-4) tests/tracer.py (+81/-8) |
To merge this branch: | bzr merge lp:~salgado/storm/fix-timeout-tracer |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella | Approve | ||
Christopher Armstrong (community) | Approve | ||
Review via email: mp+112403@code.launchpad.net |
Description of the change
Add connection commit/rollback tracer hooks and use them in the TimeoutTracer
to reset connection.
We currently don't reset connection.
when the connection is reused in a new transaction the TimeoutTracer will not
call set_statement_
greater than what's returned by self.get_
This is specially likely to happen if it's the first query you run in the
transaction that times out, as in that case when the transaction rolls back
connection.
total transaction timeout.
Oh, and I've also removed some duplicated code (a test method and StubConnection).
[1] I would prefer for the new tests in test_tracer (test_connectio n_commit_ hook and test_connection _rollback_ hook) to be blackbox instead of whitebox, since it doesn't look like that should be too hard (or at least *less* whiteboxy; something that actually invokes some connection logic and observes that the bug that you observed does not occur). Even if you don't change it, it looks like storm has a convention of using "test_wb_" for whitebox tests which you should use here.
[2] There are no tests for the changes to DebugTracer (and there is already a suite of tests for it, so it should be easy to add).
Looks good!