Commit 1df38d2
authored
Fix race when handling delegating tasks in ReferenceCountedOpenSslEngine (#12149)
Motivation:
Due incorrect handling of delegating tasks in ReferenceCountedOpenSslEngine it was possible to observe handshake timeouts / failures.
Modification:
- Only reset needsTask variable after we actually ran the task.
- Add missing synchronized as otherwise we might end up calling native code concurrently which is not safe.
- Change how we excute delegating tasks in our SSLEngineTest. This change would result in timeouts / failures before the fix.
Result:
Fixes #121391 parent 673849d commit 1df38d2
2 files changed
Lines changed: 17 additions & 20 deletions
File tree
- handler/src
- main/java/io/netty/handler/ssl
- test/java/io/netty/handler/ssl
Lines changed: 15 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1456 | 1456 | | |
1457 | 1457 | | |
1458 | 1458 | | |
1459 | | - | |
1460 | | - | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | | - | |
1465 | | - | |
| 1459 | + | |
1466 | 1460 | | |
1467 | 1461 | | |
1468 | 1462 | | |
| |||
1475 | 1469 | | |
1476 | 1470 | | |
1477 | 1471 | | |
1478 | | - | |
1479 | 1472 | | |
1480 | 1473 | | |
1481 | | - | |
1482 | | - | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
1490 | | - | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
1491 | 1488 | | |
1492 | 1489 | | |
1493 | 1490 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1712 | 1712 | | |
1713 | 1713 | | |
1714 | 1714 | | |
1715 | | - | |
| 1715 | + | |
1716 | 1716 | | |
1717 | 1717 | | |
1718 | 1718 | | |
| |||
1722 | 1722 | | |
1723 | 1723 | | |
1724 | 1724 | | |
1725 | | - | |
| 1725 | + | |
1726 | 1726 | | |
1727 | 1727 | | |
1728 | 1728 | | |
| |||
0 commit comments