Commit 2915dce
committed
It's valid to abort a txn that hasn't been started
There may be cases where dependant code starts a transaction using the
producer's `#transaction` block syntax and then an exception is raised
within that block *before* the transaction manager actually opens up a
transaction. In such cases, prior to this change, the real exception is
obfuscated, because the transaction manager would raise an exception
about not being in a valid transactional state.
With this change, attempting to abort a transaction that has not
actually been opened will no longer result in an exception. Instead it
will log a warning message and leave the transaction manager in its
ready state.1 parent d282a35 commit 2915dce
File tree
2 files changed
+10
-7
lines changed- lib/kafka
- spec
2 files changed
+10
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| |||
250 | 251 | | |
251 | 252 | | |
252 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
253 | 258 | | |
254 | 259 | | |
255 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
| 404 | + | |
| 405 | + | |
408 | 406 | | |
409 | 407 | | |
410 | | - | |
| 408 | + | |
411 | 409 | | |
412 | 410 | | |
413 | 411 | | |
414 | | - | |
| 412 | + | |
415 | 413 | | |
416 | 414 | | |
417 | 415 | | |
| |||
0 commit comments