Comments (9)
Task creates its own threads and doesn't use BeesThread, so it doesn't set the BeesThread-specific variables. That said, Task could use pthread_setname_np
and BeesThread could use pthread_getname_np
and then external tools (like iotop and debuggers) would all get the same names too.
Note that even if I fix this, it means most of the logs will end up with thread names like "worker_7", which is little more information than the tid in "pid.tid". The threads that remain will do only basic housekeeping.
from bees.
Well, so far that sounds like correct behavior. But in my logs I notice that the crawler no longer identifies itself as "crawl" but shows "bees" now. Was this intended?
from bees.
I haven't really thought about that much.
Certainly the transition from a stateful-thread model (where each thread contains state, e.g. subvol crawl position) to a stateless-thread model (where a fixed number of threads execute self-contained tasks in dependency order) was intentional. The logging code is based on the earlier stateful-thread assumptions which are not so useful in a stateless-thread world.
Task currently doesn't have a "name" field that we could write to the log (though we could add one).
BEESLOG
could just look at Task::current_task() and run the Task's "print" function as needed--but that could be very verbose. Then again, only two "print" functions have been written in Bees, so as long as we just keep the "print" output short we're OK.
I have a patch that logs worker_7
instead of bees
but I'm not sure I like it. worker_7
is not an informative thread name, and bees
is shorter. I might try fetching Task::current_task() and writing that to the log as the "thread name" instead.
from bees.
Ah okay, now I start to understand the problem. The "stateless threads" was the missing key. Maybe the correct name could be pulled from the self contained task?
I don't like the name worker neither. On the other hand, constantly changing how a thread id names itself in the log, could be confusing at best. Tho, it would make it more easy to extract, as an example, all crawler work from the logs...
from bees.
Well, we could leave the thread names alone (calling pthread_setname_np
several hundred times a second is probably not ideal) but have the log ask the Task to name itself directly as required (having every Task write a log entry isn't ideal either).
The Task names are things like "scan extent 0xf33234000" which could be useful to log (e.g. if there was an IO error, it would tell us the extent that was being processed at the time). On the other hand, I was planning to have Tasks with names like "dedup ..." (and the 3 lines of output that includes) and maybe we don't want to print those. Or on the gripping hand, the Task name could be "dedup 16K" and it could log the rest in only two lines, which would be a net improvement in many ways.
from bees.
At the first glance, I like the very last idea best.
from bees.
The master branch now writes the Task name on the log. Currently I made it look like the old subvol-threads output because the extent ref spec (BeesFileRange) was far too long. It will change over time as I get bees to be more extent-oriented instead of extent-ref oriented.
Let me know what you think.
from bees.
This looks more familiar now... Not sure if you use systemd, but it looks like this now:
from bees.
To me it looks good currently. If you feel like closing this, proceed.
from bees.
Related Issues (20)
- Missing commit from 2 years ago in v0.8 but in master??? HOT 3
- What actually is a "toxic match"? HOT 2
- RFC: bees startup and distro integration HOT 19
- Toxic hashes matches, bees DB size HOT 1
- Bees hangs up 6.1.7-1-MANJARO kernel HOT 5
- Test error on i686 and armhf (easy fix)
- GRUB: Extent not found after running bees HOT 7
- a segfault of bees HOT 2
- limit the dedup min size 64K for less fragment? HOT 2
- Bees crashes after 10 minutes of running HOT 1
- munmap when not actively scanning HOT 2
- Help with using Bees.in setup script HOT 8
- build failure with GCC 13 HOT 2
- How exactly is the compression method set and how might one go about changing it? HOT 1
- regression on linux 6.3.1: 'vmalloc error' during crawl HOT 16
- Cannot start beesd service on Archlinux HOT 5
- corrupted double-linked list HOT 17
- bees causes memory fragmentation and low cached memory HOT 24
- Bees fills the journal with 'LOGICAL_INO returned 0 refs' messages HOT 1
- Bees on Synology NAS HOT 9
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 bees.