Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kohlschutter/junixsocket
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: junixsocket-2.8.1
Choose a base ref
...
head repository: kohlschutter/junixsocket
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: junixsocket-2.8.3
Choose a head ref
  • 12 commits
  • 29 files changed
  • 2 contributors

Commits on Oct 3, 2023

  1. Configuration menu
    Copy the full SHA
    43cbb88 View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2023

  1. Fix concurrency issue from modifying the selectedKeysSet

    This bug may have been a regression introduced in optimizing the key removal: a7c3106
    
    To reproduce refer to poc:
    https://github.com/kevink-sq/jetty-concurrency-issue-poc
    
    To verify fix, refer to poc branch (same as these changes):
    https://github.com/kevink-sq/jetty-concurrency-issue-poc/tree/kevink/attempted-junixsocket-fix-2
    
    Jetty's [ManagedSelector](https://github.com/jetty/jetty.project/blob/7a7d69a69f4f51772e20813332291189a24e91b1/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java#L655)
    iterates through the selectedKeysSet and when separate processes cancel
    the AFSelectorKey, the iterator throws a `ConcurrentModificationException`.
    
    Fix is to introduce `cancelledKeysSet` to defer removal of cancelled
    keys until the select process. Use of the cancelled sets are referenced
    from java.nio.channels.spi's `AbstractSelector` and `AbstractSelectionKey`.
    
    Ideally we'd have `AFSelectionKey` extend from `AbstractSelectionKey` to
    leverage the base class's internal cancelled set
    but`AbstractSelectionKey` defines its own `isValid` and `cancel` and
    cannot override the base's final methods.
    
    Also added an atomic check to  `AFSelectionKey#cancel` to prevent "Too
    many open files" socket exception.
    kevink-sq authored and kohlschuetter committed Oct 27, 2023
    Configuration menu
    Copy the full SHA
    b8386a1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0943b15 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    819eeb6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f0bafd4 View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2023

  1. Configuration menu
    Copy the full SHA
    4b2bfc8 View commit details
    Browse the repository at this point in the history
  2. Fix concurrency issue with AFSelector

    Clients may iterate upon AFSelector.selectedKeys() while the selected
    keys are modified in another thread.
    
    Change the underlying datastructure to be thread-safe (use
    ConcurrentHashMap), and add all "ready" selectors even if they're marked
    invalid (they will be removed later).
    
    We reimplement the fix as the original patch caused a FileDescriptor
    leak and TIPC test failures.
    
    #142
    #145
    kohlschuetter committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    889ca99 View commit details
    Browse the repository at this point in the history
  3. AFSelector: Use single ConcurrentHashMap for registered/selected keys

    Since we already have a ConcurrentHashMap, let's make use of the value,
    which now indicates the "selected" state.
    
    Introduce MapValueSet, which is a view over elements of the
    "keysRegistered" map, and precisely only those elements that have a
    certain value.
    
    For each call to select, we increment the expected value, and then set
    only the actually selected entries to that value, so we don't have to
    clear the entire map.
    
    #145
    kohlschuetter committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    470e426 View commit details
    Browse the repository at this point in the history
  4. AFSelector: Bring back Java 7 compatibility

    Fix errors only occurring with -Drelease
    
    #145
    kohlschuetter committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    efacb5a View commit details
    Browse the repository at this point in the history
  5. Set version to 2.8.3

    kohlschuetter committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    0f700aa View commit details
    Browse the repository at this point in the history
  6. Update changelog

    kohlschuetter committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    cfec208 View commit details
    Browse the repository at this point in the history
  7. Update site dependency for 2.8.x only

    In 2.9.0, we will a newer kohlschutter-parent.
    kohlschuetter committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    45d0700 View commit details
    Browse the repository at this point in the history
Loading