|
40 | 40 | DEFAULT_ISOLATION = "READ COMMITTED" |
41 | 41 |
|
42 | 42 |
|
43 | | -# On the surface this might seem wrong, becasue retrying a request whose data violates |
| 43 | +# On the surface this might seem wrong, because retrying a request whose data violates |
44 | 44 | # the constraints of the database doesn't seem like a useful endeavor. However what |
45 | 45 | # happens if you have two requests that are trying to insert a row, and that row |
46 | 46 | # contains a unique, user provided value, you can get into a race condition where both |
47 | 47 | # requests check the database, see nothing with that value exists, then both attempt to |
48 | 48 | # insert it. One of the requests will succeed, the other will fail with an |
49 | 49 | # IntegrityError. Retrying the request that failed will then have it see the object |
50 | | -# created by the other request, and will have it do the appropiate action in that case. |
| 50 | +# created by the other request, and will have it do the appropriate action in that case. |
51 | 51 | # |
52 | 52 | # The most common way to run into this, is when submitting a form in the browser, if the |
53 | 53 | # user clicks twice in rapid succession, the browser will send two almost identical |
54 | 54 | # requests at basically the same time. |
55 | 55 | # |
56 | 56 | # One possible issue that this raises, is that it will slow down "legitimate" |
57 | 57 | # IntegrityError because they'll have to fail multiple times before they ultimately |
58 | | -# fail. We consider this an acceptable trade off, because determinsitic IntegrityError |
| 58 | +# fail. We consider this an acceptable trade off, because deterministic IntegrityError |
59 | 59 | # should be caught with proper validation prior to submitting records to the database |
60 | 60 | # anyways. |
61 | 61 | pyramid_retry.mark_error_retryable(IntegrityError) |
|
0 commit comments