Pull the `io_context` and threads out of `AsioFrontend`, pass in a
reference to `io_context_pool` so it can be shut down at `AsioFrontend::join`
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
fix: resolve inconsistent judgment of osd_pg_stat_report_interval_max
Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Matan Breizman <Matan.Brz@gmail.com>
`RadosDriver` needs it, and since SAL generally uses `optional_yield`,
other stores are going to need it to implement that sensibly.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Add overloads of the constructor and `start` that take an init
function, for setting up the thread before dropping into
`io_context::run`.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Just because this is what Ceph's config uses and it saves a narrowing
conversion. If we want to set a max value on the thread count, we
should do it in config.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Followup to commit 265f727481.
Fixes this error mesage under GitHub Insights (https://github.com/ceph/ceph/network/updates):
```
The property '#/updates/1/commit-message/prefix' was not of a maximum string length of 15
```
Signed-off-by: Laura Flores <lflores@ibm.com>
When using rbd CLI to map the images to NBD devices via netlink,
any errors that arose during image resizing in netlink_resize()
were not logged. Switching the error logging from using cerr to
derr helps log the errors from netlink_resize().
Signed-off-by: Ramana Raja <rraja@redhat.com>
Include device identifier or cookie in the message sent to the kernel
to resize images mapped to NBD devices using netlink. Otherwise,
netlink_resize() fails and the size of the device isn't updated.
Fixes: https://tracker.ceph.com/issues/64139
Signed-off-by: Ramana Raja <rraja@redhat.com>
Every time I looked at these functions my brain would be thrown off by
`all or ...` as I see all as the builtin function `all`:
https://docs.python.org/3/library/functions.html#all
Rename `all` so that it avoids shadowing the function `all` and avoid
some confusion for people like me.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Issue found by mypy 1.6.1. The previous code was:
`and ((sizematcher != None) or sizematcher.compare(device)`
meaning that if sizematcher is not none "return" true, but if
sizematcher is not none execute the compare method. This is of course
impossible as None will never have a compare method. I assume that the
At Kefu Chai's suggestion we can replace the None condition with an
AllMatcher object when no size is provided to create a size matcher.
This both corrects the error and makes the code much simpler and more
readable.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Typing issue was found by mypy 1.5.1. The type only accepted values
of str but based on the data and code using set_column data the
boolean assignments to the 'isHidden' key were correct and so
I updated the type to also accept bool.
A more correct fix might be to use typing.TypedDict - this would
require python 3.8 (or typing extensions) and someone more familiar
with the dashboard code :-)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Fixes https://tracker.ceph.com/issues/64150
Issue: Due to absence of null checks, the overview page was failing to
load.
Fix: Added, null check at relevant places to ensure data availability
before accessing the data.
Signed-off-by: Afreen <afreen23.git@gmail.com>
with arrow's default BUILD_WARNING_LEVEL, -Werror is added to cflags and
debug builds fail on a warning about _FORTIFY_SOURCE
Fixes: https://tracker.ceph.com/issues/63130
Signed-off-by: Casey Bodley <cbodley@redhat.com>
While submitting the log line asyncronously is reasonable,
with this implementation the EntryVector &q parameter does
not necessarily outlive the submission continuation.
This reverts commit 511af83e27.
Fixes: https://tracker.ceph.com/issues/64140
Signed-off-by: Samuel Just <sjust@redhat.com>
Namespace package support confuses mypy in regards to the
pybind/{cephfs,rados,rbd}, etc when using mypy >= 0.990.
Turning them off seems to not be a problem for the ceph code.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Found using mypy 0.990. The `yaml_representer` function returns a Node
type, not Any. Newer versions of mypy understand this and complain.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Found using mypy 0.990.
Fix mypy error by excluding both imports in the try-except block.
Type-narrow the `ex.request` variable with an assert.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Found using mypy 0.990.
Newer mypy versions see the check as tautological because `self.func` is
typed as always being `Callable` and thus always true. I don't know if
the typing is wrong or if the if-block is tautological (and redundant).
For now, silence the error by using `getattr` instead of direct
attribute access.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Found using mypy 0.990. Newer versions of mypy see that the callback
function passed to `addFilter` are expected to return a bool. Update
`cherrypy_filter` to do have the correct type.
I did not try to fix the issue that this same function seems copy-pasted
into three different files. >:-}
Signed-off-by: John Mulligan <jmulligan@redhat.com>
When run locally mypy complains about the `name` field, possibly due to
us using an old mypy version on newer versions of python (we're stuck on
a Sept. 2022 version if you weren't aware). However, this could still be
an issue in mypy as there are open issues related to the `.name` field
of an enum. Regardless, we wouldn't know - so just work around it.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Configure mypy not to use namespace packages as the cython source dirs
in src/pybind/{cephfs,rados,rbd}, etc. confuse mypy into thinking
it's an empty namespace package rather than a missing module.
Found using mypy 0.990.
Signed-off-by: John Mulligan <jmulligan@redhat.com>