question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stack Docker Support - Longer or Configurable REPL Timeouts?

See original GitHub issue

I need to use stack via docker (https://docs.haskellstack.org/en/stable/docker_integration/) but unfortunately the hard-coded 5 second timeout in intellij-haskell causes the plugin to give up before a command has a chance to run (I think).

After adding the following to my stack.yml

docker:
    enable: true

and selecting Restart Haskell Stack REPLs. I see the following:

6:43 PM	[global-stack-repl] Stack repl could not be started within 5 seconds

6:43 PM	[project-stack-repl-query-metrics-client:exe:query-metrics-client2] Stack repl could not be started within 5 seconds

6:43 PM	[global-stack-repl] No result from Stack repl within 5 seconds. Command was: :set prompt "^IntellijHaskell^\n"

I can build my project with stack build and use stack repl fine from the command line, but there is a noticeable delay caused by what I assume is the docker container starting.

I understand why a timeout is needed, but would you be open to making this configurable somehow? I believe if I could add a couple of seconds to this to account for the initial delay, this would fix my problem.

In case this is helpful:

stack --version
Version 1.5.1, Git revision 600c1f01435a10d127938709556c1682ecfd694e (4861 commits) x86_64 hpack-0.17.1

Also, just in case you’re curious as to why I need docker, I’m attempting to develop a Reflex (GHCJS) app. I can compile it fine with GHC as well, but only via docker as the GHC version of Reflex requires webkitgtk3 which seems to be broken on MacOS. Since ghci only supports ghc I’m hoping to use a stack.yml with GHC for the editor integration and a separate stack-file just for building the js.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SamProtascommented, Sep 16, 2017

Thanks for the tip, here’s my “docker specific” stack section now:

docker:
    enable: true
    run-args: ['--ulimit', 'nofile=5000:5000']

system-ghc: false

All seems good and maybe a bit more performant? I’m not sure if that makes sense, but at least it initially seems so.

I think we can consider this issue closed. Thanks again for the quick update to support my request.

1reaction
rikvdkleijcommented, Sep 12, 2017

Thats sounds great! I can test this for you as soon something is available.

After I have done this fix, I can upload the plugin (which is just a zip file) to GitHub. You can install the plugin by using Install plugin from disk in plugins

Read more comments on GitHub >

github_iconTop Results From Across the Web

TCP timeout that occurs only in Docker Swarm, not simple ...
I experienced some strange behavior of containers get lost the connection to other container, such as between Java application and Postgresql DB ...
Read more >
docker stack deploy
docker stack deploy: Create and update a stack from a `compose` file on the swarm. ... The deploy command supports compose file version...
Read more >
Compose specification - Docker Documentation
We acknowledge that no Compose implementation is expected to support all ... The long form syntax enables the configuration of additional fields that...
Read more >
dockerd - Docker Documentation
The Docker client supports connecting to a remote daemon via SSH: ... timeout a node if a valid heartbeat is not received within...
Read more >
Compose file version 3 reference - Docker Documentation
This table shows which Compose file versions support specific Docker releases. ... Top-level keys that define a section in the configuration file such...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found