-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update ouroboros-network dependency #588
Conversation
@coot There are some breaking changes in the network code, can you fix these? |
ff0b62d
to
29f02eb
Compare
This will need updating after IntersectMBO/ouroboros-network#1674 is merged (I don't think that should be too bad). |
@mrBliss your branch builds and runs fine for me. What was it that you needed help with? |
I suppose the main node itself runs fine, but the other tools probably wont, as I left a bunch of |
b23ae48
to
8fb22e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
withIOManager
starts IO manager thread. On Unix its noop, on Windows however it start a thread which fulfills asynchronous requests (like the GHC's RTS IO manager thread). It must be started once, when its started multiple times the behavior is undefined; for that reason it must be started when the application starts and the AssociateWithIOCP
function can be passed down to call sites when we create Snockets
(an abstraction over Berkeley sockets and Windows' named pipes).
@@ -204,15 +206,16 @@ benchmarkConnectTxSubmit | |||
-> TxSubmissionClient (GenTxId blk) (GenTx blk) m () | |||
-- ^ the particular txSubmission peer | |||
-> m () | |||
benchmarkConnectTxSubmit trs nc localAddr remoteAddr myTxSubClient = do | |||
benchmarkConnectTxSubmit trs nc localAddr remoteAddr myTxSubClient = withIOManager $ \iocp -> do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is wrong place to call withIOManager
. It should be started at the very top level when the application starts. We don't want two IO manager threads to complete.
cardano-node/src/Cardano/Chairman.hs
Outdated
Nothing | ||
addr | ||
`catch` handleMuxError tracer chainsVar socketPath | ||
socketPath = withIOManager $ \iocp -> do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here, withIOManager
must be called when chairman starts and then iocp :: AssociateWithIOCP
should be passed down.
@@ -106,15 +107,15 @@ submitTx :: ( RunNode blk | |||
-> GenTx blk | |||
-> Tracer IO TraceLowLevelSubmit | |||
-> IO () | |||
submitTx targetSocketFp protoInfoConfig tx tracer = do | |||
targetSocketFp' <- localSocketAddrInfo targetSocketFp | |||
submitTx targetSocketFp protoInfoConfig tx tracer = NodeToClient.withIOManager $ \iocp -> do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same applies here.
@@ -58,16 +59,17 @@ runWalletClient :: forall blk. | |||
-> SocketPath | |||
-> Tracer IO String | |||
-> IO () | |||
runWalletClient ptcl sockFp tracer = do | |||
runWalletClient ptcl sockFp tracer = withIOManager $ \iocp -> do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ok, runWalletClient
is where the wallet-client
starts.
, withIOManager | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jimbo4350 What does the style guide say about this? Does the stylish-haskell config in this repo do the right thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it does however I need to update the style guide re: imports. We want this format if imports exceed 100 chars:
import Ouroboros.Network.NodeToClient
(AssociateWithIOCP, withIOManager)
a0e40ff
to
f19b598
Compare
bors r+ |
588: Update ouroboros-network dependency r=mrBliss a=mrBliss Issue ------ Pushing through the changes made in IntersectMBO/ouroboros-network#1657 checklist --------- - [ ] This PR contains all the work required to resolve the linked issue. - [ ] This PR results in breaking changes to upstream dependencies. - [ ] The work contained has sufficient documentation to describe what it does and how to do it. - [ ] The work has sufficient tests and/or testing. - [ ] I have committed clear and descriptive commits. Be considerate as somebody else will have to read these. - [ ] I have added the appropriate labels to this PR. Co-authored-by: Thomas Winant <thomas@well-typed.com> Co-authored-by: Marcin Szamotulski <profunctor@pm.me>
bors r- |
Canceled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just some conflicts to fix.
After IntersectMBO/ouroboros-network#1657 Co-authored-by: Karl Knutsson <karl.knutsson@iohk.io>
Behaviour of IO manager depends on platform. On Unix its noop, as RTS has an io manager already; on Windows: it starts a thread which fulfills aysynchronous IO request (throuh IO completion port). `withIOManager` is used when an application starts and it must be called only once, so the best place to start is at the very begining of `main`.
6bdbf89
to
0346c6d
Compare
0346c6d
to
91cd6ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after rebasing and fixing conflicts.
@Jimbo4350 would you mind giving this a final look?
I'm going to push another bump of EDIT: done |
bors r+ |
Build succeeded |
Issue
Pushing through the changes made in IntersectMBO/ouroboros-network#1657
checklist
This PR contains all the work required to resolve the linked issue.
This PR results in breaking changes to upstream dependencies.
The work contained has sufficient documentation to describe what it does and how to do it.
The work has sufficient tests and/or testing.
I have committed clear and descriptive commits. Be considerate as somebody else will have to read these.
I have added the appropriate labels to this PR.