Comments (5)
I think this gist would work perfectly in solving our timeout issues with long running processes or those that become defunct in sosreport's presence
https://gist.github.com/1306188
from sos.
If we're going to solve this we should solve it generally (fs access via addCopySpec* is vulnerable to the same problems). I'm interested to know if anyone has ideas here but the last time I looked into fork/exec/wait in python it seemed difficult to write this kind of thing robustly. I have one solution using an external C binary that's simple and covers the command cases well but if there are other suggestions we should evaluate those too.
from sos.
It's funny you guys are talking about this... The other day I started playing around with trying to figure out how to make this work and came up with this:
https://gist.github.com/7b75afd647a8dac49ef1
There are a lot of problems with trying to make one implementation. My implementation probably doesn't work on windows, but it will let you execute via a shell (which is what most calls expect).
A c-extension won't work for jython, but we might be able to use it for platforms that do and come up with a jython implementation to fall back on.
from sos.
I'd be interested to know what happens when the child gets into trouble - is a single fork and pipe enough to protect us from hanging inside p.communicate()?
from sos.
If you mean to use /usr/bin/timeout as a prepended shell argument on systems where it exists then we can do that under jython as well.
You can try my gist out like so
python timeout.py 10 "cat /dev/random > 10_seconds_of_dev_random"
Though, I'm not sure that is a good test either, as I doubt that will fill up any pipe buffers. p.communicate() is supposed to buffer into memory so we could always get into trouble there if we are drinking from a firehose.
from sos.
Related Issues (20)
- [tests] LogsSizeLimitTest can fail on a fresh VM due to default LineMax HOT 1
- [tests] LogsSizeLimitTest.test_string_not_in_manifest false alarm when /var/log/messages are big HOT 3
- [subscription_manager] Can collect usernames/passwords in /var/lib/rhsm/repo_server_val/*
- [logs] Logs plugin will always load CoSLogs variant
- [collector] Add a wrapper to import yaml HOT 2
- [tests] networking plugin test can fail if /sys/class/net/bonding_masters file exists HOT 1
- [virsh] may collect SPICE passwords in virt-manager logs HOT 1
- [ubuntu] `--upload-url` implicitly suppress report upload for ubuntu policy HOT 1
- Typos in sos-collect manpage
- [tests] restrict foreman tests to x86_64 architecture only
- URL for commercial support seems wrong HOT 2
- [report] Rename sos_commands to sos_plugins? HOT 2
- support for pebble service manager HOT 3
- [juju] cluster collection doesn't work in 2 scenarios HOT 2
- [collect] sos collect does not detect snap HOT 3
- [networking] route call returns only IPv4 routing table
- [services] Is the services plugin still useful? HOT 3
- sos report --all-logs does not gather all rotated logs in ubuntu HOT 1
- [networking] Collect `sysctl -a` from namespaces
- [juju] add_copy_spec does not collect dot files HOT 2
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 sos.