• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JuliaLang / julia / 1576

09 Feb 2026 02:05PM UTC coverage: 75.058% (-1.7%) from 76.711%
1576

push

buildkite

web-flow
Supporting sticky (generational) immix (#57327)

Adding support for sticky immix. Needs to be merged after:

- https://github.com/JuliaLang/julia/pull/57237
- https://github.com/JuliaLang/julia/pull/57176
- https://github.com/JuliaLang/julia/pull/57252
- https://github.com/JuliaLang/julia/pull/57769

---------

Co-authored-by: Luis Eduardo de Souza Amorim <eduardo@bear.moma>

57362 of 76424 relevant lines covered (75.06%)

7438320.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

35.94
/stdlib/Sockets/src/PipeServer.jl
1
# This file is a part of Julia. License is MIT: https://julialang.org/license
2

3
mutable struct PipeServer <: LibuvServer
4
    handle::Ptr{Cvoid}
5
    status::Int
6
    cond::Base.ThreadSynchronizer
7
    function PipeServer(handle::Ptr{Cvoid}, status)
×
8
        p = new(handle,
×
9
                status,
10
                Base.ThreadSynchronizer())
11
        associate_julia_struct(p.handle, p)
×
12
        finalizer(uvfinalize, p)
×
13
        return p
×
14
    end
15
end
16

17
function PipeServer()
×
18
    pipe = PipeServer(Libc.malloc(Base._sizeof_uv_named_pipe), StatusUninit)
×
19
    iolock_begin()
×
20
    err = ccall(:uv_pipe_init, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Cint), eventloop(), pipe.handle, 0)
×
21
    uv_error("failed to create pipe server", err)
×
22
    pipe.status = StatusInit
×
23
    iolock_end()
×
24
    return pipe
×
25
end
26

27
function PipeServer(handle::OS_HANDLE)
×
28
    pipe = PipeServer()
×
29
    return Base.open_pipe!(pipe, handle)
×
30
end
31

32
function Base.open_pipe!(p::PipeServer, handle::OS_HANDLE)
×
33
    iolock_begin()
×
34
    if p.status != StatusInit
×
35
        error("pipe is already in use or has been closed")
×
36
    end
37
    err = ccall(:uv_pipe_open, Int32, (Ptr{Cvoid}, OS_HANDLE), p.handle, handle)
×
38
    uv_error("pipe_open", err)
×
39
    p.status = StatusOpen
×
40
    iolock_end()
×
41
    return p
×
42
end
43

44
## server functions ##
45

46
accept(server::PipeServer) = accept(server, PipeEndpoint())
633✔
47

48
function accept_nonblock(server::PipeServer, client::PipeEndpoint)
49
    iolock_begin()
×
50
    if client.status != StatusInit
×
51
        error("client is already in use or has been closed")
×
52
    end
53
    err = ccall(:uv_accept, Int32, (Ptr{Cvoid}, Ptr{Cvoid}), server.handle, client.handle)
×
54
    if err == 0
×
55
        client.status = StatusOpen
×
56
    end
57
    iolock_end()
×
58
    return err
×
59
end
60

61
function accept_nonblock(server::PipeServer)
×
62
    client = PipeEndpoint()
×
63
    uv_error("accept", accept_nonblock(server, client) != 0)
×
64
    return client
×
65
end
66

67
function bind(server::PipeServer, name::AbstractString)
630✔
68
    iolock_begin()
630✔
69
    @assert server.status == StatusInit
630✔
70
    err = ccall(:uv_pipe_bind, Int32, (Ptr{Cvoid}, Cstring),
630✔
71
                server, name)
72
    if err != 0
630✔
73
        iolock_end()
×
74
        if err != UV_EADDRINUSE && err != UV_EACCES
×
75
            #TODO: this codepath is currently not tested
76
            throw(_UVError("bind", err))
×
77
        else
78
            return false
×
79
        end
80
    end
81
    server.status = StatusOpen
630✔
82
    iolock_end()
630✔
83
    return true
630✔
84
end
85

86
"""
87
    listen(path::AbstractString) -> PipeServer
88

89
Create and listen on a named pipe / UNIX domain socket.
90

91
!!! note
92
    Path length on Unix is limited to somewhere between 92 and 108 bytes (cf. `man unix`).
93
"""
94
function listen(path::AbstractString)
630✔
95
    sock = PipeServer()
630✔
96
    bind(sock, path) || throw(ArgumentError("could not listen on path $path"))
630✔
97
    return listen(sock)
630✔
98
end
99

100
function connect!(sock::PipeEndpoint, path::AbstractString)
633✔
101
    iolock_begin()
633✔
102
    @assert sock.status == StatusInit
633✔
103
    req = Libc.malloc(Base._sizeof_uv_connect)
633✔
104
    uv_req_set_data(req, C_NULL)
633✔
105
    ccall(:uv_pipe_connect, Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Ptr{Cvoid}), req, sock.handle, path,
633✔
106
          @cfunction(uv_connectcb_pipe, Cvoid, (Ptr{Cvoid}, Cint)))
107
    sock.status = StatusConnecting
633✔
108
    iolock_end()
633✔
109
    return sock
633✔
110
end
111

112
"""
113
    connect(path::AbstractString) -> PipeEndpoint
114

115
Connect to the named pipe / UNIX domain socket at `path`.
116

117
!!! note
118
    Path length on Unix is limited to somewhere between 92 and 108 bytes (cf. `man unix`).
119
"""
120
connect(path::AbstractString) = connect(PipeEndpoint(), path)
633✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc