Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
cb4f6977
Unverified
Commit
cb4f6977
authored
Oct 01, 2018
by
Dominik Charousset
Committed by
GitHub
Oct 01, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #765
Demote internal messages from INFO to DEBUG
parents
f92e049a
eb2b9802
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
23 deletions
+25
-23
libcaf_core/src/actor_registry.cpp
libcaf_core/src/actor_registry.cpp
+1
-1
libcaf_io/caf/io/basp/instance.hpp
libcaf_io/caf/io/basp/instance.hpp
+7
-7
libcaf_io/src/basp_broker.cpp
libcaf_io/src/basp_broker.cpp
+10
-10
libcaf_io/src/default_multiplexer.cpp
libcaf_io/src/default_multiplexer.cpp
+7
-5
No files found.
libcaf_core/src/actor_registry.cpp
View file @
cb4f6977
...
@@ -73,7 +73,7 @@ void actor_registry::put_impl(actor_id key, strong_actor_ptr val) {
...
@@ -73,7 +73,7 @@ void actor_registry::put_impl(actor_id key, strong_actor_ptr val) {
return
;
return
;
}
}
// attach functor without lock
// attach functor without lock
CAF_LOG_
INFO
(
"added actor:"
<<
CAF_ARG
(
key
));
CAF_LOG_
DEBUG
(
"added actor:"
<<
CAF_ARG
(
key
));
actor_registry
*
reg
=
this
;
actor_registry
*
reg
=
this
;
val
->
get
()
->
attach_functor
([
key
,
reg
]()
{
val
->
get
()
->
attach_functor
([
key
,
reg
]()
{
reg
->
erase
(
key
);
reg
->
erase
(
key
);
...
...
libcaf_io/caf/io/basp/instance.hpp
View file @
cb4f6977
...
@@ -330,19 +330,19 @@ public:
...
@@ -330,19 +330,19 @@ public:
}
}
// close self connection after handshake is done
// close self connection after handshake is done
if
(
hdr
.
source_node
==
this_node_
)
{
if
(
hdr
.
source_node
==
this_node_
)
{
CAF_LOG_
INFO
(
"close connection to self immediately"
);
CAF_LOG_
DEBUG
(
"close connection to self immediately"
);
callee_
.
finalize_handshake
(
hdr
.
source_node
,
aid
,
sigs
);
callee_
.
finalize_handshake
(
hdr
.
source_node
,
aid
,
sigs
);
return
false
;
return
false
;
}
}
// close this connection if we already have a direct connection
// close this connection if we already have a direct connection
if
(
tbl_
.
lookup_direct
(
hdr
.
source_node
))
{
if
(
tbl_
.
lookup_direct
(
hdr
.
source_node
))
{
CAF_LOG_
INFO
(
"close connection since we already have a "
CAF_LOG_
DEBUG
(
"close connection since we already have a "
"direct connection: "
<<
CAF_ARG
(
hdr
.
source_node
));
"direct connection: "
<<
CAF_ARG
(
hdr
.
source_node
));
callee_
.
finalize_handshake
(
hdr
.
source_node
,
aid
,
sigs
);
callee_
.
finalize_handshake
(
hdr
.
source_node
,
aid
,
sigs
);
return
false
;
return
false
;
}
}
// add direct route to this node and remove any indirect entry
// add direct route to this node and remove any indirect entry
CAF_LOG_
INFO
(
"new direct connection:"
<<
CAF_ARG
(
hdr
.
source_node
));
CAF_LOG_
DEBUG
(
"new direct connection:"
<<
CAF_ARG
(
hdr
.
source_node
));
tbl_
.
add_direct
(
hdl
,
hdr
.
source_node
);
tbl_
.
add_direct
(
hdl
,
hdr
.
source_node
);
auto
was_indirect
=
tbl_
.
erase_indirect
(
hdr
.
source_node
);
auto
was_indirect
=
tbl_
.
erase_indirect
(
hdr
.
source_node
);
// write handshake as client in response
// write handshake as client in response
...
@@ -381,12 +381,12 @@ public:
...
@@ -381,12 +381,12 @@ public:
}
}
if
(
tcp_based
)
{
if
(
tcp_based
)
{
if
(
tbl_
.
lookup_direct
(
hdr
.
source_node
))
{
if
(
tbl_
.
lookup_direct
(
hdr
.
source_node
))
{
CAF_LOG_
INFO
(
"received second client handshake:"
CAF_LOG_
DEBUG
(
"received second client handshake:"
<<
CAF_ARG
(
hdr
.
source_node
));
<<
CAF_ARG
(
hdr
.
source_node
));
break
;
break
;
}
}
// add direct route to this node and remove any indirect entry
// add direct route to this node and remove any indirect entry
CAF_LOG_
INFO
(
"new direct connection:"
<<
CAF_ARG
(
hdr
.
source_node
));
CAF_LOG_
DEBUG
(
"new direct connection:"
<<
CAF_ARG
(
hdr
.
source_node
));
tbl_
.
add_direct
(
hdl
,
hdr
.
source_node
);
tbl_
.
add_direct
(
hdl
,
hdr
.
source_node
);
auto
was_indirect
=
tbl_
.
erase_indirect
(
hdr
.
source_node
);
auto
was_indirect
=
tbl_
.
erase_indirect
(
hdr
.
source_node
);
callee_
.
learned_new_node_directly
(
hdr
.
source_node
,
was_indirect
);
callee_
.
learned_new_node_directly
(
hdr
.
source_node
,
was_indirect
);
...
@@ -395,7 +395,7 @@ public:
...
@@ -395,7 +395,7 @@ public:
&&
!
tbl_
.
lookup_direct
(
hdr
.
source_node
));
&&
!
tbl_
.
lookup_direct
(
hdr
.
source_node
));
if
(
new_node
)
{
if
(
new_node
)
{
// add direct route to this node and remove any indirect entry
// add direct route to this node and remove any indirect entry
CAF_LOG_
INFO
(
"new direct connection:"
<<
CAF_ARG
(
hdr
.
source_node
));
CAF_LOG_
DEBUG
(
"new direct connection:"
<<
CAF_ARG
(
hdr
.
source_node
));
tbl_
.
add_direct
(
hdl
,
hdr
.
source_node
);
tbl_
.
add_direct
(
hdl
,
hdr
.
source_node
);
}
}
uint16_t
seq
=
(
ep
&&
ep
->
requires_ordering
)
?
ep
->
seq_outgoing
++
:
0
;
uint16_t
seq
=
(
ep
&&
ep
->
requires_ordering
)
?
ep
->
seq_outgoing
++
:
0
;
...
...
libcaf_io/src/basp_broker.cpp
View file @
cb4f6977
...
@@ -106,7 +106,7 @@ strong_actor_ptr basp_broker_state::make_proxy(node_id nid, actor_id aid) {
...
@@ -106,7 +106,7 @@ strong_actor_ptr basp_broker_state::make_proxy(node_id nid, actor_id aid) {
if
(
!
path
)
{
if
(
!
path
)
{
// this happens if and only if we don't have a path to `nid`
// this happens if and only if we don't have a path to `nid`
// and current_context_->hdl has been blacklisted
// and current_context_->hdl has been blacklisted
CAF_LOG_
INFO
(
"cannot create a proxy instance for an actor "
CAF_LOG_
DEBUG
(
"cannot create a proxy instance for an actor "
"running on a node we don't have a route to"
);
"running on a node we don't have a route to"
);
return
nullptr
;
return
nullptr
;
}
}
...
@@ -127,7 +127,7 @@ strong_actor_ptr basp_broker_state::make_proxy(node_id nid, actor_id aid) {
...
@@ -127,7 +127,7 @@ strong_actor_ptr basp_broker_state::make_proxy(node_id nid, actor_id aid) {
bptr
->
state
.
proxies
().
erase
(
nid
,
res
->
id
(),
rsn
);
bptr
->
state
.
proxies
().
erase
(
nid
,
res
->
id
(),
rsn
);
});
});
});
});
CAF_LOG_
INFO
(
"successfully created proxy instance, "
CAF_LOG_
DEBUG
(
"successfully created proxy instance, "
"write announce_proxy_instance:"
"write announce_proxy_instance:"
<<
CAF_ARG
(
nid
)
<<
CAF_ARG
(
aid
));
<<
CAF_ARG
(
nid
)
<<
CAF_ARG
(
aid
));
auto
&
ctx
=
*
this_context
;
auto
&
ctx
=
*
this_context
;
...
@@ -159,7 +159,7 @@ void basp_broker_state::finalize_handshake(const node_id& nid, actor_id aid,
...
@@ -159,7 +159,7 @@ void basp_broker_state::finalize_handshake(const node_id& nid, actor_id aid,
if
(
nid
==
this_node
())
{
if
(
nid
==
this_node
())
{
// connected to self
// connected to self
ptr
=
actor_cast
<
strong_actor_ptr
>
(
system
().
registry
().
get
(
aid
));
ptr
=
actor_cast
<
strong_actor_ptr
>
(
system
().
registry
().
get
(
aid
));
CAF_LOG_
INFO
_IF
(
!
ptr
,
"actor not found:"
<<
CAF_ARG
(
aid
));
CAF_LOG_
DEBUG
_IF
(
!
ptr
,
"actor not found:"
<<
CAF_ARG
(
aid
));
}
else
{
}
else
{
ptr
=
namespace_
.
get_or_put
(
nid
,
aid
);
ptr
=
namespace_
.
get_or_put
(
nid
,
aid
);
CAF_LOG_ERROR_IF
(
!
ptr
,
"creating actor in finalize_handshake failed"
);
CAF_LOG_ERROR_IF
(
!
ptr
,
"creating actor in finalize_handshake failed"
);
...
@@ -440,7 +440,7 @@ void basp_broker_state::set_context(connection_handle hdl) {
...
@@ -440,7 +440,7 @@ void basp_broker_state::set_context(connection_handle hdl) {
CAF_LOG_TRACE
(
CAF_ARG
(
hdl
));
CAF_LOG_TRACE
(
CAF_ARG
(
hdl
));
auto
i
=
ctx_tcp
.
find
(
hdl
);
auto
i
=
ctx_tcp
.
find
(
hdl
);
if
(
i
==
ctx_tcp
.
end
())
{
if
(
i
==
ctx_tcp
.
end
())
{
CAF_LOG_
INFO
(
"create new BASP context:"
<<
CAF_ARG
(
hdl
));
CAF_LOG_
DEBUG
(
"create new BASP context:"
<<
CAF_ARG
(
hdl
));
i
=
ctx_tcp
.
emplace
(
i
=
ctx_tcp
.
emplace
(
hdl
,
hdl
,
basp
::
endpoint_context
{
basp
::
endpoint_context
{
...
@@ -460,7 +460,7 @@ void basp_broker_state::set_context(datagram_handle hdl) {
...
@@ -460,7 +460,7 @@ void basp_broker_state::set_context(datagram_handle hdl) {
CAF_LOG_TRACE
(
CAF_ARG
(
hdl
));
CAF_LOG_TRACE
(
CAF_ARG
(
hdl
));
auto
i
=
ctx_udp
.
find
(
hdl
);
auto
i
=
ctx_udp
.
find
(
hdl
);
if
(
i
==
ctx_udp
.
end
())
{
if
(
i
==
ctx_udp
.
end
())
{
CAF_LOG_
INFO
(
"create new BASP context:"
<<
CAF_ARG
(
hdl
));
CAF_LOG_
DEBUG
(
"create new BASP context:"
<<
CAF_ARG
(
hdl
));
i
=
ctx_udp
.
emplace
(
i
=
ctx_udp
.
emplace
(
hdl
,
hdl
,
basp
::
endpoint_context
{
basp
::
endpoint_context
{
...
@@ -643,7 +643,7 @@ behavior basp_broker::make_behavior() {
...
@@ -643,7 +643,7 @@ behavior basp_broker::make_behavior() {
state
.
allow_tcp
=
!
get_or
(
config
(),
"middleman.disable-tcp"
,
false
);
state
.
allow_tcp
=
!
get_or
(
config
(),
"middleman.disable-tcp"
,
false
);
state
.
allow_udp
=
get_or
(
config
(),
"middleman.enable-udp"
,
false
);
state
.
allow_udp
=
get_or
(
config
(),
"middleman.enable-udp"
,
false
);
if
(
get_or
(
config
(),
"middleman.enable-automatic-connections"
,
false
))
{
if
(
get_or
(
config
(),
"middleman.enable-automatic-connections"
,
false
))
{
CAF_LOG_
INFO
(
"enable automatic connections"
);
CAF_LOG_
DEBUG
(
"enable automatic connections"
);
// open a random port and store a record for our peers how to
// open a random port and store a record for our peers how to
// connect to this broker directly in the configuration server
// connect to this broker directly in the configuration server
if
(
state
.
allow_tcp
)
{
if
(
state
.
allow_tcp
)
{
...
@@ -673,7 +673,7 @@ behavior basp_broker::make_behavior() {
...
@@ -673,7 +673,7 @@ behavior basp_broker::make_behavior() {
auto
heartbeat_interval
=
get_or
(
config
(),
"middleman.heartbeat-interval"
,
auto
heartbeat_interval
=
get_or
(
config
(),
"middleman.heartbeat-interval"
,
defaults
::
middleman
::
heartbeat_interval
);
defaults
::
middleman
::
heartbeat_interval
);
if
(
heartbeat_interval
>
0
)
{
if
(
heartbeat_interval
>
0
)
{
CAF_LOG_
INFO
(
"enable heartbeat"
<<
CAF_ARG
(
heartbeat_interval
));
CAF_LOG_
DEBUG
(
"enable heartbeat"
<<
CAF_ARG
(
heartbeat_interval
));
send
(
this
,
tick_atom
::
value
,
heartbeat_interval
);
send
(
this
,
tick_atom
::
value
,
heartbeat_interval
);
}
}
return
{
return
{
...
...
libcaf_io/src/default_multiplexer.cpp
View file @
cb4f6977
...
@@ -768,10 +768,10 @@ expected<native_socket>
...
@@ -768,10 +768,10 @@ expected<native_socket>
new_tcp_connection
(
const
std
::
string
&
host
,
uint16_t
port
,
new_tcp_connection
(
const
std
::
string
&
host
,
uint16_t
port
,
optional
<
protocol
::
network
>
preferred
)
{
optional
<
protocol
::
network
>
preferred
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
host
)
<<
CAF_ARG
(
port
)
<<
CAF_ARG
(
preferred
));
CAF_LOG_TRACE
(
CAF_ARG
(
host
)
<<
CAF_ARG
(
port
)
<<
CAF_ARG
(
preferred
));
CAF_LOG_
INFO
(
"try to connect to:"
<<
CAF_ARG
(
host
)
<<
CAF_ARG
(
port
));
CAF_LOG_
DEBUG
(
"try to connect to:"
<<
CAF_ARG
(
host
)
<<
CAF_ARG
(
port
));
auto
res
=
interfaces
::
native_address
(
host
,
std
::
move
(
preferred
));
auto
res
=
interfaces
::
native_address
(
host
,
std
::
move
(
preferred
));
if
(
!
res
)
{
if
(
!
res
)
{
CAF_LOG_
INFO
(
"no such host"
);
CAF_LOG_
DEBUG
(
"no such host"
);
return
make_error
(
sec
::
cannot_connect_to_node
,
"no such host"
,
host
,
port
);
return
make_error
(
sec
::
cannot_connect_to_node
,
"no such host"
,
host
,
port
);
}
}
auto
proto
=
res
->
second
;
auto
proto
=
res
->
second
;
...
@@ -781,7 +781,8 @@ new_tcp_connection(const std::string& host, uint16_t port,
...
@@ -781,7 +781,8 @@ new_tcp_connection(const std::string& host, uint16_t port,
detail
::
socket_guard
sguard
(
fd
);
detail
::
socket_guard
sguard
(
fd
);
if
(
proto
==
ipv6
)
{
if
(
proto
==
ipv6
)
{
if
(
ip_connect
<
AF_INET6
>
(
fd
,
res
->
first
,
port
))
{
if
(
ip_connect
<
AF_INET6
>
(
fd
,
res
->
first
,
port
))
{
CAF_LOG_INFO
(
"successfully connected to host via IPv6"
);
CAF_LOG_INFO
(
"successfully connected to (IPv6):"
<<
CAF_ARG
(
host
)
<<
CAF_ARG
(
port
));
return
sguard
.
release
();
return
sguard
.
release
();
}
}
sguard
.
close
();
sguard
.
close
();
...
@@ -789,11 +790,12 @@ new_tcp_connection(const std::string& host, uint16_t port,
...
@@ -789,11 +790,12 @@ new_tcp_connection(const std::string& host, uint16_t port,
return
new_tcp_connection
(
host
,
port
,
ipv4
);
return
new_tcp_connection
(
host
,
port
,
ipv4
);
}
}
if
(
!
ip_connect
<
AF_INET
>
(
fd
,
res
->
first
,
port
))
{
if
(
!
ip_connect
<
AF_INET
>
(
fd
,
res
->
first
,
port
))
{
CAF_LOG_
INFO
(
"could not connect to:"
<<
CAF_ARG
(
host
)
<<
CAF_ARG
(
port
));
CAF_LOG_
WARNING
(
"could not connect to:"
<<
CAF_ARG
(
host
)
<<
CAF_ARG
(
port
));
return
make_error
(
sec
::
cannot_connect_to_node
,
return
make_error
(
sec
::
cannot_connect_to_node
,
"ip_connect failed"
,
host
,
port
);
"ip_connect failed"
,
host
,
port
);
}
}
CAF_LOG_INFO
(
"successfully connected to host via IPv4"
);
CAF_LOG_INFO
(
"successfully connected to (IPv4):"
<<
CAF_ARG
(
host
)
<<
CAF_ARG
(
port
));
return
sguard
.
release
();
return
sguard
.
release
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment