forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfa703b3
committed
Fix error handling with threads on OOM in ECPG connection logic
An out-of-memory failure happening when allocating the structures tostore the connection parameter keywords and values would mess up withthe set of connections saved, as on failure the pthread mutex wouldstill be hold with the new connection object listed but free()'d.Rather than just unlocking the mutex, which would leave the static listof connections into an inconsistent state, move the allocation for thestructures of the connection parameters before beginning the testmanipulation. This ensures that the list of connections and theconnection mutex remain consistent all the time in this code path.This error is unlikely going to happen, but this could mess up badlywith ECPG clients in surprising ways, so backpatch all the way down.Reported-by: ryancaicseDiscussion:https://postgr.es/m/17186-b4cfd8f0eb4d1dee@postgresql.orgBackpatch-through: 9.61 parentfee1040 commitfa703b3
1 file changed
+39
-32
lines changedLines changed: 39 additions & 32 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
458 | 458 |
| |
459 | 459 |
| |
460 | 460 |
| |
461 |
| - | |
462 |
| - | |
463 |
| - | |
464 |
| - | |
465 |
| - | |
466 |
| - | |
467 |
| - | |
468 |
| - | |
469 |
| - | |
470 |
| - | |
471 |
| - | |
472 |
| - | |
473 |
| - | |
474 |
| - | |
475 |
| - | |
476 |
| - | |
477 |
| - | |
478 |
| - | |
479 |
| - | |
480 |
| - | |
481 |
| - | |
482 |
| - | |
483 |
| - | |
484 |
| - | |
485 |
| - | |
486 |
| - | |
487 |
| - | |
488 |
| - | |
489 |
| - | |
490 |
| - | |
491 |
| - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
492 | 465 |
| |
493 | 466 |
| |
494 | 467 |
| |
| |||
499 | 472 |
| |
500 | 473 |
| |
501 | 474 |
| |
502 |
| - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
503 | 480 |
| |
504 | 481 |
| |
505 | 482 |
| |
| |||
522 | 499 |
| |
523 | 500 |
| |
524 | 501 |
| |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
525 | 532 |
| |
526 | 533 |
| |
527 | 534 |
| |
|
0 commit comments
Comments
(0)