this silences the warnings like:
```
from
/srv/autobuild-ceph/gitbuilder.git/build/out~/ceph-11.0.0-513-gfe98b0b/src/java/native/libcephfs_jni.cc:33:
warning:
/srv/autobuild-ceph/gitbuilder.git/build/out~/ceph-11.0.0-513-gfe98b0b/src/include/ceph_fs.h:373:0:
"CEPH_SETATTR_MODE" redefined [enabled by default]
^
In file included from
/srv/autobuild-ceph/gitbuilder.git/build/out~/ceph-11.0.0-513-gfe98b0b/src/java/native/libcephfs_jni.cc:32:0:
/srv/autobuild-ceph/gitbuilder.git/build/out~/ceph-11.0.0-513-gfe98b0b/src/include/cephfs/libcephfs.h:106:0:
note: this is the location of the previous definition
^
```
Signed-off-by: Kefu Chai <kchai@redhat.com>
Added the same functionality as the previous gtest/gmock branches -
.gitignore and not installing shared libs that we only want to
statically link to test programs.
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
Google Mock has been absorbed into the Google Test project, and
is now available under the googletest repository.
Signed-off-by: Anirudha Bose <ani07nov@gmail.com>
Rather ordinary rename cases failed in the unlink step. Fix this,
unifying the unlink path while at it.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
I tried using these settings in tests without success. The correct config names
are prefixed with "mds".
Fixes: http://tracker.ceph.com/issues/16664
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
the mock_open() does not support "for i in open()", and readline() and
readlines() support was added in py3.3 and py3.4 so for better backwards
compatibility, we should change the code being tested to use the plain
read() call.
and also use open(path) instead of open(path, 'rb') for simplicity,
otherwise we need to use bytestring for comparison and pass the same
parameters to mock.
Signed-off-by: Kefu Chai <kchai@redhat.com>
this fixes the pep8 failure:
```
pep8 runtests: commands[0] | flake8 ceph_detect_init tests
tests/test_all.py:121:17: E128 continuation line under-indented for
visual indent
tests/test_all.py:125:17: E128 continuation line under-indented for
visual indent
tests/test_all.py:129:17: E128 continuation line under-indented for
visual indent
tests/test_all.py:133:17: E128 continuation line under-indented for
visual indent
```
Signed-off-by: Kefu Chai <kchai@redhat.com>
1. A -> B
2. goto standby
3. B mark down
4. A reconnect to B
5. got reset session and dispatch remote reset
6. because remote reset is executed in DispatchQueue, it will be delayed
7. A -> B successfully and begin to send message
8. assert because we found the first message is missing but it's reasonble
if policy.resetcheck is true
Signed-off-by: Haomai Wang <haomai@xsky.com>
because we want to get the right log sequence which mixes ceph logginer and
cerr. Otherwise, cerr output make the logs a little disordered.
Signed-off-by: Haomai Wang <haomai@xsky.com>
Otherwise if message in queue, we will continue to reconnect right now,
it won't meet our expectation that we want our connect request delay
Signed-off-by: Haomai Wang <haomai@xsky.com>
When replacing and someone called mark_down, it will delete_time_event which
isn't allowed. Because we're exchaning EventCenter now!
Signed-off-by: Haomai Wang <haomai@xsky.com>
When we create event thread, it need a little time to enter event loop(like
calling set_owner), if caller is going to call create_file_event before event
thread enter event loop, it will trigger assert.
Signed-off-by: Haomai Wang <haomai@xsky.com>
EventCenter::init is called by other thread instead of event thread, so we
need to move create_file_event to set_owner which is called by event thread.
Signed-off-by: Haomai Wang <haomai@xsky.com>
Previously we only exchange fd when replacing, now we will introduce dpdk
plugin in the near future. It needs all fd used locally which not like
kernel socket shared by all cores.
So we need to add EventCenter swapping to let each socket is associated to
EventCenter.
Signed-off-by: Haomai Wang <haomai@xsky.com>
We are make each AsyncConnection/AsyncMessenger only modify its file event
in event thread. So make sure create/delete_file_event aren't directly called.
Signed-off-by: Haomai Wang <haomai@xsky.com>
Since we are going to close all epoll and cleanup resources, no need to delete
notify fd resource. And another reason is "delete_file_event" doesn't expect
other threads to call
Signed-off-by: Haomai Wang <haomai@xsky.com>
We don't want net_handler rely on config value, caller may expect to pass
different value to set_socket_options according to different socket type
like heartbeat, client socket or server socket.
Signed-off-by: Haomai Wang <haomai@xsky.com>
Various issues can lead to an oversized cache, which
is a precursor to an OOM condition: let's give users
a clearer message with some useful counts that might
hint at what is wrong.
Fixes: http://tracker.ceph.com/issues/16570
Signed-off-by: John Spray <john.spray@redhat.com>