Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-rados: implement new aio_stat. #11006

Merged
merged 1 commit into from Sep 19, 2016
Merged

python-rados: implement new aio_stat. #11006

merged 1 commit into from Sep 19, 2016

Conversation

iain-buclaw-sociomantic
Copy link
Contributor

This change adds python API for the following C methods:

  • rados_aio_stat

Signed-off-by: Iain Buclaw iain.buclaw@sociomantic.com

@iain-buclaw-sociomantic
Copy link
Contributor Author

Would this suffer from the same problem as aio_read?

@jdurgin
Copy link
Member

jdurgin commented Sep 7, 2016

this looks good, could you add a simple test for it to src/test/pybind/test_rados.py?

What problem with aio_read are you encountering?

@iain-buclaw-sociomantic
Copy link
Contributor Author

What problem with aio_read are you encountering?

I see that with aio_read, it stores the buffer inside the python completion. Just wondering if the same would be required for aio_stat too.

https://github.com/ceph/ceph/blob/master/src/pybind/rados/rados.pyx#L2125-L2130

@iain-buclaw-sociomantic
Copy link
Contributor Author

Rebased, previous HEAD was 41e3e00

lock.wait()
eq(comp.get_return_value(), -2)

self.ioctx.write("foo", "bar")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the data written should be a bytes object for python 3

@jdurgin
Copy link
Member

jdurgin commented Sep 10, 2016

I'm not certain whether it's required, but it's more clearly correct to explicitly include the reference to the time and size in the completion object

@iain-buclaw-sociomantic
Copy link
Contributor Author

I'm not certain whether it's required, but it's more clearly correct to explicitly include the reference to the time and size in the completion object

Well, I've been running a migration script for over a week straight now that uses aio_stat(), and I'm not seeing any leaking of memory from here.

This change adds python API for the following C methods:
* rados_aio_stat

Signed-off-by: Iain Buclaw <iain.buclaw@sociomantic.com>
@jdurgin
Copy link
Member

jdurgin commented Sep 19, 2016

Good to know. For my own edification I verified that pmtime and psize are saved in a closure for on_complete() by reading the intermediate C code. Thanks!

@jdurgin jdurgin merged commit cce5810 into ceph:master Sep 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants