Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zircon
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zircon
Commits
7b29d09d
Commit
7b29d09d
authored
10 years ago
by
Michael Gray
Browse files
Options
Downloads
Patches
Plain Diff
Prep work for optionally passing timestamp down through stack from Protocol to Context.
parent
e6461588
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/Zircon/Connection.pm
+5
-5
5 additions, 5 deletions
lib/Zircon/Connection.pm
lib/Zircon/Context/ZMQ.pm
+9
-9
9 additions, 9 deletions
lib/Zircon/Context/ZMQ.pm
with
14 additions
and
14 deletions
lib/Zircon/Connection.pm
+
5
−
5
View file @
7b29d09d
...
...
@@ -90,21 +90,21 @@ sub close {
# client
sub
send
{
my
(
$self
,
$request
,
$
request_id
)
=
@_
;
my
(
$self
,
$request
,
$
header
)
=
@_
;
if
(
$request_id
)
{
if
(
my
$request_id
=
$header
->
{
request_id
}
)
{
$request_id
>=
$self
->
my_request_id
or
die
sprintf
('
request_id [%d] out of sync, exp [%d]
',
$request_id
,
$self
->
my_request_id
);
$self
->
my_request_id
(
$request_id
);
}
else
{
$request_id
=
$self
->
my_request_id
;
$
header
->
{
request_id
}
=
$self
->
my_request_id
;
}
$self
->
zircon_trace
("
start
");
my
$reply
;
my
(
$rv
,
$collision
)
=
$self
->
context
->
send
(
$request
,
\
$reply
,
$
request_id
);
$self
->
my_request_id
(
++
$request_id
);
# it either worked or failed hard (maybe timed out after retries)
my
(
$rv
,
$collision
)
=
$self
->
context
->
send
(
$request
,
\
$reply
,
$
header
);
$self
->
my_request_id
(
++
$
header
->
{
request_id
}
);
# it either worked or failed hard (maybe timed out after retries)
my
$collision_result
=
'
clear
';
if
(
$collision
)
{
...
...
This diff is collapsed.
Click to expand it.
lib/Zircon/Context/ZMQ.pm
+
9
−
9
View file @
7b29d09d
...
...
@@ -259,7 +259,7 @@ sub _process_server_request {
sub
platform
{
return
'
ZMQ
';
}
sub
_collision_handler
{
my
(
$self
,
$
my_sec
,
$my_usec
)
=
@_
;
my
(
$self
,
$
our_header
)
=
@_
;
$self
->
zircon_trace
("
collision detected!
");
...
...
@@ -269,10 +269,10 @@ sub _collision_handler {
return
;
}
my
$
h
=
$self
->
_parse_request_header
;
my
$cmp
=
(
$
my_sec
<=>
$h
->
{
clock_sec
}
my
$
their_header
=
$self
->
_parse_request_header
;
my
$cmp
=
(
$
our_header
->
{
clock_sec
}
<=>
$their_header
->
{
clock_sec
}
||
$
my_usec
<=>
$h
->
{
clock_usec
}
$
our_header
->
{
clock_usec
}
<=>
$their_header
->
{
clock_usec
}
||
$self
->
local_endpoint
cmp
$self
->
remote_endpoint
);
if
(
$cmp
<
0
)
{
...
...
@@ -286,15 +286,15 @@ sub _collision_handler {
}
sub
send
{
my
(
$self
,
$request
,
$reply_ref
,
$
request_id
)
=
@_
;
my
(
$self
,
$request
,
$reply_ref
,
$
conn_header
)
=
@_
;
my
$error
=
'
unset
';
my
$zerr
;
my
(
$sec
,
$usec
)
=
gettimeofday
;
my
$header
=
{
%$conn_header
,
msg_type
=>
'
REQUEST
',
request_id
=>
$request_id
,
clock_sec
=>
$sec
,
clock_usec
=>
$usec
,
};
...
...
@@ -327,8 +327,8 @@ sub send {
socket
=>
$requester
,
events
=>
ZMQ_POLLIN
,
callback
=>
sub
{
my
(
$header
,
$error
);
(
$header
,
$reply_msg
,
$error
)
=
$self
->
_get_two_part
(
$requester
);
my
(
$
reply_
header
,
$error
);
(
$
reply_
header
,
$reply_msg
,
$error
)
=
$self
->
_get_two_part
(
$requester
);
warn
"
Zircon::Context::ZMQ::send: zmq_recvmsg failed:
$error
"
if
$error
;
return
;
},
...
...
@@ -336,7 +336,7 @@ sub send {
my
%server_request_pollitem
=
(
socket
=>
$responder
,
events
=>
ZMQ_POLLIN
,
callback
=>
sub
{
return
$self
->
_collision_handler
(
$
sec
,
$usec
);
},
callback
=>
sub
{
return
$self
->
_collision_handler
(
$
header
);
},
);
$self
->
zircon_trace
('
waiting for reply
');
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment