Comments (4)
Interesting use case. I never use pumactl
, but I totally understand that use cases, as well as more general cases when stdin/stdout/stderr are redirected. To be honest, I don't have any experience of how to deal with it correctly for now. There are some things pop from my head:
- It's true that Jard should detect when STDIN and STDOUT are redirected,or not TTY. In such cases, Jard should print a warning, and let the program continue and never attach the program.
- We can even go further than that, try to detect user/program tty, and work on those files instead. This approach is adopted by less, tmux, and other similar programs. They made use of
dev/tty
to do so. Luckily, it is supported by operation system level in both linux and mac, and independent to terminal emulator. I'm not really sure about the side effects though. - About debugging containers, I would like to propose to use remote debugging instead. There are a lot of use cases that the debugging target is outside of developer machines, on staging VPS, or deep inside kubernetes clusters.
docker -it
orkubectl exec
are not very friendly. Developers have to start the process inside, expose the ports, and work inside that foreign container. It's not as convenient as developer's local environment. All the output are streamed via the internet may cause lagging experience, and even weird quirks. Supporting remote debugging allows Jard interrupts a running server, debugs right in developer machine via a secure TCP socket with a proper protocol (DAP?). That solution serves more use cases, safer, and seems to be faster.
What do you think about this? Would love to hear more about it.
from ruby_jard.
@nonnenmacher it turns out that I already implemetned the solution that Jard detects user tty, and bind into that instead of STDIN/STDOUT. The solution is described at #51, and tested with "easy" redirection. However, I didn't solve the case that the process is detached, or created in an isolated process group, or doesn't have a tty device at all.
from ruby_jard.
@nonnenmacher it turns out that I already implemetned the solution that Jard detects user tty, and bind into that instead of STDIN/STDOUT. The solution is described at #51, and tested with "easy" redirection. However, I didn't solve the case that the process is detached, or created in an isolated process group, or doesn't have a tty device at all.
Its totally fine, for this it isn't a big problem to relaunch in non deamonized
mode and possibly this is the way to go inside a Docker container anyway (not yet tested).
Great solution for either quick REPL/Debug on a dev server and in last resort before suicide on a production node
dirty investigation/hot fix ;-)
from ruby_jard.
@nonnenmacher I tested with docker. And it works, as soon as there is a tty device attached to the docker container. I noted it down at https://rubyjard.org/docs/guides/faq#can-ruby-jard-work-with-docker. I'll think of a safer solution to debug on production, but not sure who gonna have that use case though 😄
from ruby_jard.
Related Issues (20)
- dRB compatibility? HOT 2
- Error with Ruby 3.2, need pry > 0.14
- [BUG] Error on app startup -1 out of range HOT 3
- [BUG] Internal error from jard - undefined method `shift` for nil HOT 1
- [BUG] HOT 2
- [BUG] Source output incorrect HOT 2
- Supporting "disable-pry" kind of functionality HOT 2
- Support for JRuby HOT 2
- Breakpoint in initializer throws error "undefined method `to_hash' for nil:NilClass" HOT 1
- Pager isn't working HOT 8
- [BUG] Control command is empty HOT 3
- Anyone able to use this on Rails with Passenger? HOT 2
- [BUG] Not compatible with Rails CurrentAttributes - attributes come back as nil HOT 3
- [BUG] Can not step into subsequent calls on the same line of code (only the call which is evaluated first by Ruby)
- [BUG] Debugging console freezes when executing a Rails' association on a model instance HOT 1
- Support Ruby 2.4
- Error uninitialized constant #<Class:0x00007f96b6e8aa68>::Analyzable
- [BUG] empty space below the prompt when running in Rails project on WSL/Ubuntu HOT 2
- [BUG] ~/.jardrc does not seem to work with Rails Console HOT 1
- Keyword to output the underlying SQL query of Active Record relation to the console
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby_jard.